Beispiel #1
0
 /**
  * try/finally is required if you want to support 'break' in a generator, but
  * unfortunately PHP 5.6 doesn't work properly as of 5.6.10:
  * https://bugs.php.net/bug.php?id=69740
  * @group faulty
  */
 function testChildCheckReplacementBreak()
 {
     $schema = new \Fulfil\Schema(['props' => ['foo' => new \Fulfil\Filter\String_(['trim' => true])]]);
     $replacement = new \Fulfil\Check\Basic();
     foreach ($schema->childChecks(!!'replace') as &$check) {
         $check = $replacement;
         break;
     }
     $this->assertEquals([$replacement], $schema->props['foo']);
 }