/** * @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()); }
/** * @return array[propertyName => Prototype] */ public static function getPropertyPrototypes() { return ['id' => IntegerOrNull::prototype(), 'name' => String::prototype(), 'age' => Integer::prototype()]; }