14
14
use Doctrine \Common \Persistence \ManagerRegistry ;
15
15
use Doctrine \ODM \PHPCR \DocumentManager ;
16
16
use Doctrine \ODM \PHPCR \UnitOfWork ;
17
+ use PHPUnit \Framework \TestCase ;
17
18
use Symfony \Cmf \Bundle \CoreBundle \PublishWorkflow \PublishWorkflowChecker ;
18
19
use Symfony \Cmf \Bundle \CoreBundle \Templating \Helper \Cmf ;
19
20
use Symfony \Cmf \Component \Routing \RouteReferrersReadInterface ;
21
+ use Symfony \Component \Config \Definition \Exception \InvalidConfigurationException ;
20
22
use Symfony \Component \Routing \Route ;
21
23
use Symfony \Component \Security \Core \Authorization \AuthorizationCheckerInterface ;
22
24
23
- class CmfTest extends \PHPUnit_Framework_TestCase
25
+ class CmfTest extends TestCase
24
26
{
25
27
private $ pwc ;
26
28
@@ -220,9 +222,6 @@ public function testFindManyLimitOffset()
220
222
$ this ->assertEquals ([$ documentB ], $ this ->helper ->findMany (['/foo ' , 'bar ' ], 1 , 1 , null ));
221
223
}
222
224
223
- /**
224
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
225
- */
226
225
public function testFindManyNoWorkflow ()
227
226
{
228
227
$ extension = new Cmf (null );
@@ -236,6 +235,7 @@ public function testFindManyNoWorkflow()
236
235
->will ($ this ->returnValue ($ documentA ))
237
236
;
238
237
238
+ $ this ->expectException (InvalidConfigurationException::class);
239
239
$ extension ->findMany (['/foo ' , '/bar ' ], false , false );
240
240
}
241
241
@@ -255,14 +255,12 @@ public function testIsPublished()
255
255
$ this ->assertTrue ($ this ->helper ->isPublished ($ document ));
256
256
}
257
257
258
- /**
259
- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
260
- */
261
258
public function testIsPublishedNoWorkflow ()
262
259
{
263
260
$ extension = new Cmf (null );
264
261
$ extension ->setDoctrineRegistry ($ this ->managerRegistry , 'foo ' );
265
262
263
+ $ this ->expectException (InvalidConfigurationException::class);
266
264
$ extension ->isPublished (new \stdClass ());
267
265
}
268
266
0 commit comments