Пример #1
0
 public function testEndWith()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->endWith(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Value is undefined')->if($asserter->setWith($string = __METHOD__))->and($diff = new diffs\variable())->then->exception(function () use($asserter, &$fragment) {
         $asserter->endWith($fragment = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($this->getLocale()->_('String does not end with %s'), $fragment))->object($asserter->endWith($string))->isIdenticalTo($asserter)->if($asserter->setWith($string . uniqid()))->then->exception(function () use($asserter, $string) {
         $asserter->endWith($string);
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($this->getLocale()->_('String does not end with %s'), $string))->if($asserter->setWith(uniqid() . $string))->then->object($asserter->endWith($string))->isIdenticalTo($asserter)->exception(function () use($asserter, $string, &$fragment) {
         $asserter->endWith($fragment = strtoupper($string));
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($this->getLocale()->_('String does not end with %s'), $fragment));
 }