Пример #1
0
 public function setTest(test $test)
 {
     $asserter = null;
     $test->getAssertionManager()->setHandler('json', function ($json, $depth = null, $options = null) use($test, &$asserter) {
         if ($asserter === null) {
             $asserter = new atoum\jsonSchema\asserters\json($test->getAsserterGenerator());
         }
         return $asserter->setWith($json, $depth, $options);
     });
     return $this;
 }
Пример #2
0
 public function testNotValidatesJsonArrayGrammar($json)
 {
     $this->assert($json)->if($asserter = new testedClass())->then->object($asserter->setWith($json))->isIdenticalTo($asserter)->exception(function () use($asserter) {
         $asserter->validates('{"title": "test", "type": "array"}');
     });
 }