Beispiel #1
0
 public function testEnumInList()
 {
     $message = EmailMessage::create()->addToList('enum_in_list', [Provider::AOL(), Provider::AOL(), Provider::GMAIL(), Provider::GMAIL()]);
     $result = array_map(function (Enum $enum) {
         return $enum->getValue();
     }, $message->get('enum_in_list'));
     $this->assertCount(4, $result);
     $this->assertSame($result, ['aol', 'aol', 'gmail', 'gmail']);
 }
Beispiel #2
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'];
 }