-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #394 from dkisselev/integration-tests
Add Twig integration tests for common methods
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--TEST-- | ||
"badge" function | ||
--TEMPLATE-- | ||
{{ badge('42') }} | ||
--DATA-- | ||
return array(); | ||
--EXPECT-- | ||
<span class="badge">42</span> |
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,8 @@ | ||
--TEST-- | ||
"icon" function | ||
--TEMPLATE-- | ||
{{ icon('camera') }} | ||
--DATA-- | ||
return array(); | ||
--EXPECT-- | ||
<span class="fa fa-camera"></span> |
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,16 @@ | ||
--TEST-- | ||
"label" functions | ||
--TEMPLATE-- | ||
{{ label('Default') }} | ||
{{ label_success('Success') }} | ||
{{ label_primary('Primary') }} | ||
{{ label_warning('Warning') }} | ||
{{ label_danger('Danger') }} | ||
--DATA-- | ||
return array(); | ||
--EXPECT-- | ||
<span class="label label-default">Default</span> | ||
<span class="label label-success">Success</span> | ||
<span class="label label-primary">Primary</span> | ||
<span class="label label-warning">Warning</span> | ||
<span class="label label-danger">Danger</span> |
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,26 @@ | ||
<?php | ||
|
||
use Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapBadgeExtension; | ||
use Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapButtonExtension; | ||
use Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapFormExtension; | ||
use Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapIconExtension; | ||
use Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapLabelExtension; | ||
|
||
class Project_Tests_IntegrationTest extends Twig_Test_IntegrationTestCase | ||
{ | ||
public function getExtensions() | ||
{ | ||
return array( | ||
new BootstrapBadgeExtension(), | ||
new BootstrapButtonExtension(new BootstrapIconExtension("fa")), | ||
new BootstrapFormExtension(), | ||
new BootstrapIconExtension("fa"), | ||
new BootstrapLabelExtension(), | ||
); | ||
} | ||
|
||
public function getFixturesDir() | ||
{ | ||
return dirname(__FILE__).'/Fixtures/'; | ||
} | ||
} |