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

Function test_preprocess_forelse

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

Source from the content-addressed store, hash-verified

517
518 #[test]
519 fn test_preprocess_forelse() {
520 let content = r#"@forelse($users as $user)
521 <p>{{ $user->name }}</p>
522@empty
523 <p>No users</p>
524@endforelse
525"#;
526 let (php, _) = preprocess(content);
527 for (i, line) in php.lines().enumerate() {
528 eprintln!("{:2}: {}", i, line);
529 }
530 assert!(php.contains("foreach"), "should contain foreach: {}", php);
531 assert!(
532 php.contains("endforeach"),
533 "should contain endforeach: {}",
534 php
535 );
536 assert!(
537 php.contains("if (false):"),
538 "should contain if (false): {}",
539 php
540 );
541 assert!(php.contains("endif;"), "should contain endif: {}", php);
542 }
543
544 #[test]
545 fn test_preprocess_session_directive() {

Callers

nothing calls this directly

Calls 1

preprocessFunction · 0.85

Tested by

no test coverage detected