/** * Tests if the merge method, based on a TargetInjectionDescriptor initialized from * a property works successfully. * * @return void */ public function testMergeSuccessfulWithProperty() { // initialize a new descriptor from one of our properties $descriptor = InjectionTargetDescriptor::newDescriptorInstance(); $descriptor->fromReflectionProperty(new ReflectionProperty(__CLASS__, 'dummyResource')); // initialize a descriptor from another property $this->descriptor->fromReflectionProperty(new ReflectionProperty(__CLASS__, 'dummyEnterpriseBean')); $this->descriptor->merge($descriptor); // check the descriptor values $this->assertSame(__CLASS__, $this->descriptor->getTargetClass()); $this->assertSame('dummyResource', $this->descriptor->getTargetProperty()); $this->assertNull($this->descriptor->getTargetMethod()); }