MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / test_preprocess_foreach

Function test_preprocess_foreach

src/blade/preprocessor.rs:500–516  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

498
499 #[test]
500 fn test_preprocess_foreach() {
501 let content = r#"@php
502/**
503 * @var \App\Models\AuthorCollection $users
504 */
505@endphp
506
507@foreach($users->active()->byName() as $user)
508 <p>{{ $user->name }}</p>
509@endforeach
510"#;
511 let (php, _) = preprocess(content);
512 for (i, line) in php.lines().enumerate() {
513 eprintln!("{:2}: {}", i, line);
514 }
515 assert!(php.contains("$user->name"));
516 }
517
518 #[test]
519 fn test_preprocess_forelse() {

Callers

nothing calls this directly

Calls 1

preprocessFunction · 0.85

Tested by

no test coverage detected