예제 #1
0
 public function testAddToMessage()
 {
     $message = EmailMessage::create();
     $field = DynamicField::createFloatVal('float_val', 3.14);
     $message->addToList('dynamic_fields', [$field]);
     $this->assertTrue($message->getFromListAt('dynamic_fields', 0)->equals($field));
 }
예제 #2
0
 public function testAnyOfMessageInList()
 {
     $message = EmailMessage::create()->addToList('any_of_message', [MapsMessage::create()->addToMap('String', 'test:field:name', 'value1'), NestedMessage::create()->set('test1', 'value1')]);
     $this->assertCount(2, $message->get('any_of_message'));
 }
예제 #3
0
 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'];
 }