Exemple #1
0
 public function testAddMethodPhpVersion()
 {
     $this->if($test = new notEmptyTest())->then->exception(function () use($test, &$method) {
         $test->addMethodPhpVersion($method, '6.0');
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Test method ' . get_class($test) . '::' . $method . '() does not exist')->object($test->addMethodPhpVersion('testMethod1', '5.3'))->isIdenticalTo($test)->array($test->getMethodPhpVersions())->isEqualTo(array('testMethod1' => array('5.3' => '>='), 'testMethod2' => array()))->array($test->getMethodPhpVersions('testMethod1'))->isEqualTo(array('5.3' => '>='))->array($test->getMethodPhpVersions('testMethod2'))->isEmpty()->object($test->addMethodPhpVersion('testMethod1', '5.4', '<='))->isIdenticalTo($test)->array($test->getMethodPhpVersions())->isEqualTo(array('testMethod1' => array('5.3' => '>=', '5.4' => '<='), 'testMethod2' => array()))->array($test->getMethodPhpVersions('testMethod1'))->isEqualTo(array('5.3' => '>=', '5.4' => '<='))->array($test->getMethodPhpVersions('testMethod2'))->isEmpty()->object($test->addMethodPhpVersion('testMethod2', '5.4', '>='))->isIdenticalTo($test)->array($test->getMethodPhpVersions())->isEqualTo(array('testMethod1' => array('5.3' => '>=', '5.4' => '<='), 'testMethod2' => array('5.4' => '>=')))->array($test->getMethodPhpVersions('testMethod1'))->isEqualTo(array('5.3' => '>=', '5.4' => '<='))->array($test->getMethodPhpVersions('testMethod2'))->isEqualTo(array('5.4' => '>='))->if($test->addClassPhpVersion('5.5'))->then->array($test->getMethodPhpVersions())->isEqualTo(array('testMethod1' => array('5.5' => '>=', '5.3' => '>=', '5.4' => '<='), 'testMethod2' => array('5.5' => '>=', '5.4' => '>=')))->array($test->getMethodPhpVersions('testMethod1'))->isEqualTo(array('5.5' => '>=', '5.3' => '>=', '5.4' => '<='))->array($test->getMethodPhpVersions('testMethod2'))->isEqualTo(array('5.5' => '>=', '5.4' => '>='));
 }