Esempio n. 1
0
 public function testSizeCallback()
 {
     $field = new Int(function () {
         return 6;
     });
     $this->assertEquals(6, $field->getSize());
 }
Esempio n. 2
0
 public function testCreation()
 {
     $callback = function ($value) {
         return $value - 2 * 8;
     };
     $field = new Int('byte', ['signed' => true, 'formatter' => $callback]);
     $this->assertSame(8, $field->getSize());
     $this->assertSame($callback, $field->getFormatter());
     $this->assertTrue($field->getSigned());
 }