[null, 'null'], 'boolean true' => [true, 'true'], 'boolean false' => [false, 'false'], 'integer' => [42, '42'], 'float' => [1337.404, '1337.404'], 'string with single quote' => ['foo', "'foo'"], 'string with double quote' => ["foo'bar", '"foo\'bar"'], 'string with both quotes' => ['"foo\'bar"', '\'"foo\\\'bar"\''], 'string with exact max length' => ['Lorem ipsum dolor sit amet, consectetur adipiscing', "'Lorem ipsum dolor sit amet, consectetur adipiscing'"], 'string cropped' => ['Lorem ipsum dolor sit amet, consectetur adipiscing elit.', "'Lorem ipsum dolor sit amet, consectetur adipiscing…'"], 'string cropped only after threshold' => ['Lorem12345 ipsumdolorsitamet,consecteturadipiscingelit.Curabitur', "'Lorem12345 ipsumdolorsitamet,consecteturadipiscinge…'"], 'string without space cropped' => ['Loremipsumdolorsitamet,consecteturadipiscingelit.Curabitur',"'Loremipsumdolorsitamet,consecteturadipiscingelit.Cu…'"], 'date' => [new DateTimeImmutable('@1648733888'), '2022/03/31 13:38:08'], 'object' => [new stdClass(), 'object(stdClass)'], 'array' => [['foo' => 'bar', 'baz'], "array{foo: 'bar', 0: 'baz'}"], 'array with in-depth entries' => [['foo' => ['bar' => 'baz']], "array{foo: array{…}}"], 'array with too much entries' => [[0, 1, 2, 3, 4, 5, 6, 7], "array{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, …}"], ]; } /** * @PHP8.1 move to data provider * * @requires PHP >= 8.1 */ public function test_dump_enum_value_returns_correct_signature(): void { self::assertSame('FOO', ValueDumper::dump(PureEnum::FOO)); self::assertSame('foo', ValueDumper::dump(BackedStringEnum::FOO)); self::assertSame('42', ValueDumper::dump(BackedIntegerEnum::FOO)); } }