public function testCreateMessageFromArray() { /** @var EmailMessage $message */ $message = $this->createEmailMessage(); $message->set('priority', Priority::HIGH()); $this->assertTrue($message->get('priority')->equals(Priority::HIGH)); $this->assertTrue(Priority::HIGH() === $message->get('priority')); $json = $this->getSerializer()->serialize($message); $message = $this->getSerializer()->deserialize($json); $this->assertTrue($message->get('priority')->equals(Priority::HIGH)); $this->assertTrue(Priority::HIGH() === $message->get('priority')); $this->assertSame($message->get('nested')->get('location')->getLatitude(), 0.5); //echo json_encode($message, JSON_PRETTY_PRINT); //echo json_encode($message->schema(), JSON_PRETTY_PRINT); //echo json_encode($message->schema()->getMixins(), JSON_PRETTY_PRINT); }
protected function getInvalidTypeValues() { return ['BigInt' => [new BigNumber(-1), new BigNumber('18446744073709551616')], 'Binary' => false, 'Blob' => false, 'Boolean' => 'not_a_bool', 'Date' => 'not_a_date', 'DateTime' => 'not_a_date', 'Decimal' => 1, 'DynamicField' => 'not_a_dynamic_field', 'Float' => 1, 'GeoPoint' => 'not_a_geo_point', 'IntEnum' => Priority::NORMAL(), 'Int' => [-1, 4294967296], 'MediumInt' => [-1, 16777216], 'MediumBlob' => false, 'MediumText' => false, 'Message' => EmailMessage::create(), 'MessageRef' => 'not_a_message_ref', 'Microtime' => microtime(), 'SignedBigInt' => [new BigNumber('-9223372036854775809'), new BigNumber('9223372036854775808')], 'SignedMediumInt' => [-8388609, 8388608], 'SignedSmallInt' => [-32769, 32768], 'SignedTinyInt' => [-129, 128], 'SmallInt' => [-1, 65536], 'StringEnum' => Provider::AOL(), 'String' => false, 'Text' => false, 'TimeUuid' => 'not_a_time_uuid', 'Timestamp' => 'not_a_timestamp', 'TinyInt' => [-1, 256], 'Uuid' => 'not_a_uuid']; }