/**
  * @test
  */
 function it_can_be_converted_to_array_and_back()
 {
     $processingTypes = ProcessingTypes::support([String::prototype(), Integer::prototype()]);
     $definition = $processingTypes->toArray();
     $copiedProcessingTypes = ProcessingTypes::fromArray($definition);
     $this->assertTrue($copiedProcessingTypes->isSupported(String::prototype()));
     $this->assertTrue($copiedProcessingTypes->isSupported(Integer::prototype()));
     $this->assertFalse($copiedProcessingTypes->isSupported(Float::prototype()));
     $allProcessingTypes = ProcessingTypes::supportAll();
     $definition = $allProcessingTypes->toArray();
     $copiedProcessingTypes = ProcessingTypes::fromArray($definition);
     $this->assertTrue($copiedProcessingTypes->isSupported(Float::prototype()));
 }
示例#2
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return array('id' => Integer::prototype(), 'name' => String::prototype(), 'address' => SourceAddress::prototype());
 }
示例#3
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return ['id' => IntegerOrNull::prototype(), 'name' => String::prototype(), 'age' => Integer::prototype()];
 }
示例#4
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return array('street' => String::prototype(), 'streetNumber' => Integer::prototype(), 'zip' => String::prototype(), 'city' => String::prototype());
 }
示例#5
0
 /**
  * @test
  */
 public function it_is_same_value_as_equal_integer()
 {
     $int1 = Integer::fromNativeValue(10);
     $int2 = Integer::fromNativeValue(10);
     $int3 = Integer::fromNativeValue(20);
     $this->assertTrue($int1->sameAs($int2));
     $this->assertFalse($int1->sameAs($int3));
 }
示例#6
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return ['name' => \Prooph\Processing\Type\String::prototype(), 'age' => \Prooph\Processing\Type\Integer::prototype(), 'created_at' => \Prooph\Processing\Type\DateTime::prototype(), 'price' => \Prooph\Processing\Type\Float::prototype(), 'active' => \Prooph\Processing\Type\Boolean::prototype()];
 }
示例#7
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return ['ean' => String::prototype(), 'name' => String::prototype(), 'price' => Integer::prototype(), 'currency' => String::prototype()];
 }