()
| 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() { |
nothing calls this directly
no test coverage detected