public function testMethods()
 {
     $this->if($object = new Device('Test', array('param' => 'test')))->boolean($object->hasParameter('param'))->isTrue()->string($object->getParameter('param'))->isEqualTo('test')->boolean($object->hasParameter('notExist'))->isFalse()->variable($object->getParameter('notExist'))->isNull()->string($object->getParameter('renotExist', '12345'))->isEqualTo('12345')->when($object->setParameters(array('chuck' => 'norris')))->boolean($object->hasParameter('chuck'))->isTrue()->string($object->getParameter('chuck'))->isEqualTo('norris')->when($object->setParameter('poney', 'powerful'))->boolean($object->hasParameter('poney'))->isTrue()->string($object->getParameter('poney'))->isEqualTo('powerful')->when($object->setParameter('null', null))->boolean($object->hasParameter('null'))->isTrue()->variable($object->getParameter('null'))->isNull();
 }
Ejemplo n.º 2
0
 public function testConstruct()
 {
     $this->if($object = new TestedModel('t0k3n'))->string($object->getToken())->isEqualTo('t0k3n')->array($object->getParameters())->isEmpty();
     $this->if($object = new TestedModel('t0k3n', array('param' => 'test')))->string($object->getToken())->isEqualTo('t0k3n')->when($object->setToken('t0k3ns3tt3d'))->string($object->getToken())->isEqualTo('t0k3ns3tt3d')->array($object->getParameters())->hasKey('param')->contains('test')->size->isEqualTo(1);
 }