-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BC Remove deprecated code for Symfony 2.7 and add tests
- Loading branch information
Jérôme Poskin
committed
Sep 25, 2015
1 parent
1394df0
commit 0f2f72f
Showing
5 changed files
with
85 additions
and
7 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,49 @@ | ||
<?php | ||
|
||
namespace Snowcap\BootstrapBundle\Tests\Twig\Extension; | ||
|
||
use Snowcap\BootstrapBundle\Twig\Extension\BootstrapExtension; | ||
|
||
class BootstrapExtensionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* @var BootstrapExtension | ||
*/ | ||
private $extension; | ||
|
||
/** | ||
* Sets the extension | ||
*/ | ||
public function setUp() | ||
{ | ||
$this->extension = new BootstrapExtension(); | ||
} | ||
|
||
/** | ||
* Test that the name is correctly set | ||
*/ | ||
public function testGetName() | ||
{ | ||
$this->assertSame('snowcap_bootstrap', $this->extension->getName(), 'getName: '); | ||
} | ||
|
||
/** | ||
* Test that the functions are correctly set | ||
*/ | ||
public function testGetFunctions() | ||
{ | ||
$filters = $this->extension->getFunctions(); | ||
$this->assertInstanceOf('\Twig_SimpleFunction', $filters['form_row_classes']); | ||
} | ||
|
||
/** | ||
* Test the getFormRowClasses method | ||
*/ | ||
public function testGetFormRowClasses() | ||
{ | ||
$this->assertEquals('type_foo', $this->extension->getFormRowClasses(['foo'])); | ||
$this->assertEquals('type_bar', $this->extension->getFormRowClasses(['bar'])); | ||
$this->assertEquals('type_foo type_bar', $this->extension->getFormRowClasses(['foo', 'bar'])); | ||
} | ||
} |
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,3 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; |
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
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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit | ||
bootstrap="Tests/bootstrap.php" | ||
> | ||
<testsuites> | ||
<testsuite name="Snowcap BootstrapBundle Test Suite"> | ||
<directory>./Tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./</directory> | ||
<exclude> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |