コード例 #1
0
ファイル: BeanTest.php プロジェクト: nagyist/qti-sdk
 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);
 }
コード例 #2
0
 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());
 }