示例#1
0
 /**
  * @test
  */
 public function it_constructs_a_prototype()
 {
     $intPrototype = IntegerOrNull::prototype();
     $this->assertInstanceOf('Prooph\\Processing\\Type\\Prototype', $intPrototype);
     $description = $intPrototype->typeDescription();
     $this->assertEquals('Prooph\\Processing\\Type\\IntegerOrNull', $intPrototype->of());
     $this->assertEquals('Integer', $description->label());
     $this->assertEquals('integer', $description->nativeType());
     $this->assertFalse($description->hasIdentifier());
 }
示例#2
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return ['id' => IntegerOrNull::prototype(), 'name' => String::prototype(), 'age' => Integer::prototype()];
 }