Exemple #1
0
 public function testGetMethodTags()
 {
     $this->if($test = new notEmptyTest())->then->array($test->getMethodTags('testMethod1'))->isEqualTo(array('test', 'method', 'one'))->exception(function () use($test, &$method) {
         $test->getMethodTags($method = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Test method ' . get_class($test) . '::' . $method . '() does not exist')->if($test = new inheritedTagsTest())->then->array($test->getMethodTags())->isEqualTo(array('testMethod1' => array('first', 'second', 'third'), 'testMethod2' => array('first', 'second', 'third')))->array($test->getMethodTags('testMethod1'))->isEqualTo(array('first', 'second', 'third'))->array($test->getMethodTags('testMethod2'))->isEqualTo(array('first', 'second', 'third'))->if($test = new dataProviderTest())->then->array($test->getMethodTags())->isEqualTo(array('testMethod1' => array(), 'testMethod2' => array(), 'testMethod3' => array()))->array($test->getMethodTags('testMethod1'))->isEqualTo(array())->array($test->getMethodTags('testMethod2'))->isEqualTo(array())->array($test->getMethodTags('testMethod3'))->isEqualTo(array());
 }
Exemple #2
0
 public function testSetMethodTags()
 {
     $this->if($test = new notEmptyTest())->then->object($test->setMethodTags('testMethod1', $tags = array(uniqid(), uniqid())))->isIdenticalTo($test)->array($test->getMethodTags('testMethod1'))->isEqualTo($tags)->exception(function () use($test, &$method) {
         $test->setMethodTags($method = uniqid(), array());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Test method ' . get_class($test) . '::' . $method . '() does not exist');
 }