-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[5.4] Implement standalone if empty in a NB-Change-Way (#18738)
* 5.4 Implement if empty in as NB-Change * Fix little StyleCI Issue * Fix little StyleCI Issue #2 * Fix little StyleCI Issue #3 * Update CompilesLoops.php
- Loading branch information
1 parent
73c673e
commit 3687363
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Illuminate\Tests\Blade; | ||
|
||
use Mockery as m; | ||
use PHPUnit\Framework\TestCase; | ||
use Illuminate\View\Compilers\BladeCompiler; | ||
|
||
class BladeIfEmptyStatementsTest extends TestCase | ||
{ | ||
public function tearDown() | ||
{ | ||
m::close(); | ||
} | ||
|
||
public function testIfStatementsAreCompiled() | ||
{ | ||
$compiler = new BladeCompiler($this->getFiles(), __DIR__); | ||
$string = '@empty ($test) | ||
breeze | ||
@endempty'; | ||
$expected = '<?php if(empty($test)): ?> | ||
breeze | ||
<?php endif; ?>'; | ||
$this->assertEquals($expected, $compiler->compileString($string)); | ||
} | ||
|
||
protected function getFiles() | ||
{ | ||
return m::mock('Illuminate\Filesystem\Filesystem'); | ||
} | ||
} |