public function testPropertyButNoSetter() { $mock = new SimpleBean('Name', 'Car'); $bean = new Bean($mock); $this->setExpectedException('\\qtism\\common\\beans\\BeanException', "The bean has no public setter for a 'noGetter' property."); $setter = $bean->getSetter('noGetter', BeanException::NO_METHOD); }
public function testGetSetterByBeanProperty() { $mock = new StrictBean('John', 'Dunbar', 'white', false); $bean = new Bean($mock, true); $property = $bean->getProperty('cool'); $setter = $bean->getSetter($property); $this->assertEquals('setCool', $setter->getName()); }