-
Notifications
You must be signed in to change notification settings - Fork 128
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 #178 from helios-ag/phpunit
increased number of tests
- Loading branch information
Showing
12 changed files
with
306 additions
and
26 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 |
---|---|---|
|
@@ -7,6 +7,8 @@ php: | |
- 7.0 | ||
- hhvm | ||
|
||
sudo: false | ||
|
||
matrix: | ||
allow_failures: | ||
- 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
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 | ||
|
||
namespace FM\ElfinderBundle\Tests\DependencyInjection\Compiler; | ||
|
||
use FM\ElfinderBundle\DependencyInjection\Compiler\TwigFormPass; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
/** | ||
* Class TwigFormPassTest. | ||
*/ | ||
class TwigFormPassTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testProcess() | ||
{ | ||
$container = new ContainerBuilder(); | ||
$pass = new TwigFormPass(); | ||
$pass->process($container); | ||
$this->assertFalse($container->hasParameter('twig.form.resources')); | ||
$container = new ContainerBuilder(); | ||
$container->setParameter('twig.form.resources', array()); | ||
$pass->process($container); | ||
$this->assertEquals(array( | ||
'FMElfinderBundle:Form:elfinder_widget.html.twig', | ||
), $container->getParameter('twig.form.resources')); | ||
} | ||
} |
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
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,50 @@ | ||
<?php | ||
|
||
namespace FM\ElfinderBundle\Tests\Form\Type; | ||
|
||
use FM\ElfinderBundle\Form\Type\ElFinderType; | ||
use Symfony\Component\Form\Forms; | ||
use Symfony\Component\Form\Test\TypeTestCase; | ||
|
||
/** | ||
* Class ElFinderTypeTest | ||
* @package FM\ElfinderBundle\Tests | ||
*/ | ||
class ElFinderTypeTest extends TypeTestCase | ||
{ | ||
|
||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$elfinderType = new ElFinderType(); | ||
$this->factory = Forms::createFormFactoryBuilder() | ||
->addType($elfinderType) | ||
->getFormFactory(); | ||
} | ||
|
||
public function testDefaults() | ||
{ | ||
$form = $this->factory->create('elfinder'); | ||
$view = $form->createView(); | ||
|
||
$this->assertTrue($view->vars['enable']); | ||
} | ||
|
||
public function testDefaultInstance() | ||
{ | ||
$form = $this->factory->create('elfinder'); | ||
$view = $form->createView(); | ||
|
||
$this->assertSame('', $view->vars['instance']); | ||
} | ||
|
||
public function testDefaultHomeFolder() | ||
{ | ||
$form = $this->factory->create('elfinder'); | ||
$view = $form->createView(); | ||
|
||
$this->assertSame('', $view->vars['homeFolder']); | ||
} | ||
|
||
} |
Oops, something went wrong.