Example #1
0
 public function testMethods()
 {
     $definition = new Definition();
     $definition->method('code', function () {
         return true;
     })->method('repeat', function ($text) {
         return $text;
     });
     $obj1 = $definition->build();
     $this->assertEquals(true, $obj1->code());
     $this->assertEquals('test', $obj1->repeat('test'));
     for ($i = 2; $i < 10; ++$i) {
         $obj = $definition->build();
         $this->assertEquals(true, $obj->code());
         $this->assertEquals('test', $obj->repeat('test'));
     }
 }