44
55use Liip \FunctionalTestBundle \Test \WebTestCase ;
66use Liip \TestFixturesBundle \Test \FixturesTrait ;
7+ use JMose \CommandSchedulerBundle \Fixtures \ORM \LoadScheduledCommandData ;
78
89/**
910 * Class DetailControllerTest
@@ -18,9 +19,9 @@ class DetailControllerTest extends WebTestCase
1819 */
1920 public function testInitNewScheduledCommand ()
2021 {
22+ $ client = parent ::createClient ();
2123 $ this ->loadFixtures (array ());
2224
23- $ client = parent ::createClient ();
2425 $ crawler = $ client ->request ('GET ' , '/command-scheduler/detail/new ' );
2526 $ this ->assertEquals (1 , $ crawler ->filter ('button[id="command_scheduler_detail_save"] ' )->count ());
2627 }
@@ -30,12 +31,10 @@ public function testInitNewScheduledCommand()
3031 */
3132 public function testInitEditScheduledCommand ()
3233 {
34+ $ client = parent ::createClient ();
3335 //DataFixtures create 4 records
34- $ this ->loadFixtures (array (
35- 'JMose\CommandSchedulerBundle\Fixtures\ORM\LoadScheduledCommandData '
36- ));
36+ $ this ->loadFixtures (array (LoadScheduledCommandData::class));
3737
38- $ client = parent ::createClient ();
3938 $ crawler = $ client ->request ('GET ' , '/command-scheduler/detail/edit/1 ' );
4039 $ this ->assertEquals (1 , $ crawler ->filter ('button[id="command_scheduler_detail_save"] ' )->count ());
4140
@@ -48,20 +47,22 @@ public function testInitEditScheduledCommand()
4847 'command_scheduler_detail[arguments] ' => "--help " ,
4948 'command_scheduler_detail[cronExpression] ' => "@daily " ,
5049 'command_scheduler_detail[logFile] ' => "one.log " ,
51- 'command_scheduler_detail[priority] ' => "100 "
50+ 'command_scheduler_detail[priority] ' => "100 " ,
51+ 'command_scheduler_detail[save] ' => '' ,
5252 );
5353
54- $ this ->assertArraySubset ($ fixtureSet , $ form ->getValues ());
54+ $ this ->assertEquals ($ fixtureSet , $ form ->getValues ());
5555 }
5656
5757 /**
5858 * Test new scheduling creation
5959 */
6060 public function testNewSave ()
6161 {
62+ $ client = parent ::createClient ();
63+
6264 $ this ->loadFixtures (array ());
6365
64- $ client = parent ::createClient ();
6566 $ client ->followRedirects (true );
6667 $ crawler = $ client ->request ('GET ' , '/command-scheduler/detail/new ' );
6768 $ buttonCrawlerNode = $ crawler ->selectButton ('Save ' );
@@ -86,12 +87,11 @@ public function testNewSave()
8687 */
8788 public function testEditSave ()
8889 {
90+ $ client = parent ::createClient ();
91+
8992 //DataFixtures create 4 records
90- $ this ->loadFixtures (array (
91- 'JMose\CommandSchedulerBundle\Fixtures\ORM\LoadScheduledCommandData '
92- ));
93+ $ this ->loadFixtures (array (LoadScheduledCommandData::class));
9394
94- $ client = parent ::createClient ();
9595 $ client ->followRedirects (true );
9696 $ crawler = $ client ->request ('GET ' , '/command-scheduler/detail/edit/1 ' );
9797 $ buttonCrawlerNode = $ crawler ->selectButton ('Save ' );
0 commit comments