22
33namespace Matthias \SymfonyDependencyInjectionTest \PhpUnit ;
44
5- use SebastianBergmann \Exporter \Exporter ;
5+ use PHPUnit \Framework \Constraint \Constraint ;
6+ use PHPUnit \Framework \Constraint \IsEqual ;
67use Symfony \Component \DependencyInjection \ContainerBuilder ;
78
8- class ContainerBuilderHasServiceDefinitionConstraint extends \PHPUnit_Framework_Constraint
9+ class ContainerBuilderHasServiceDefinitionConstraint extends Constraint
910{
1011 private $ serviceId ;
1112 private $ expectedClass ;
1213 private $ checkExpectedClass ;
13- protected $ exporter ;
1414
1515 public function __construct ($ serviceId , $ expectedClass = null , $ checkExpectedClass = true )
1616 {
17+ parent ::__construct ();
18+
1719 if (!is_string ($ serviceId )) {
1820 throw new \InvalidArgumentException ('The $serviceId argument should be a string ' );
1921 }
@@ -25,7 +27,6 @@ public function __construct($serviceId, $expectedClass = null, $checkExpectedCla
2527 $ this ->serviceId = $ serviceId ;
2628 $ this ->expectedClass = $ expectedClass ;
2729 $ this ->checkExpectedClass = $ checkExpectedClass ;
28- $ this ->exporter = new Exporter ;
2930 }
3031
3132 public function toString ()
@@ -81,7 +82,7 @@ private function evaluateClass(ContainerBuilder $containerBuilder, $returnResult
8182
8283 $ actualClass = $ containerBuilder ->getParameterBag ()->resolveValue ($ definition ->getClass ());
8384
84- $ constraint = new \ PHPUnit_Framework_Constraint_IsEqual ($ this ->expectedClass );
85+ $ constraint = new IsEqual ($ this ->expectedClass );
8586
8687 if (!$ constraint ->evaluate ($ actualClass , '' , true )) {
8788 if ($ returnResult ) {
0 commit comments