Ejemplo n.º 1
0
 protected function __construct()
 {
     $objectBuilderFactory = new ObjectBuilderFactory();
     $this->objectBuilder = $objectBuilderFactory->getObjectBuilder();
     $this->diConfig = new DiConfig();
     $this->validation = new Validation();
 }
 public function testBuildingAnObjectWithParameters()
 {
     // ARRANGE
     $objectBuilderFactory = new ObjectBuilderFactory();
     $objectBuilder = $objectBuilderFactory->getObjectBuilder();
     $desiredClassname = '\\DirtyNeedle\\TestFixtures\\NestedDependencies\\ClassWithOneDependency';
     $arrayOfParameters = [new SimpleDependency()];
     // ACT
     $object = $objectBuilder->buildObject($desiredClassname, $arrayOfParameters);
     // ASSERT
     $this->assertInstanceOf($desiredClassname, $object);
 }