public function addResource(Resource $resource) { $className = $resource->getClassName(); if (true === isset($this->resources[$className])) { throw new \InvalidArgumentException(sprintf('Resource for class %s has been added', $className)); } $this->resources[$className] = $resource; }
/** @test **/ public function it_has_type_and_target_entity_class() { $this->assertEquals('entity', $this->resource->getName()); $this->assertEquals(EntityStub::class, $this->resource->getClassName()); }