Skip to content

Commit 7161859

Browse files
committed
tests: removed PHP < 7 support
1 parent 08451e0 commit 7161859

7 files changed

+6
-25
lines changed

tests/PhpGenerator/ClassType.from.php7.phpt renamed to tests/PhpGenerator/ClassType.from.anonymous.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Test: Nette\PhpGenerator generator.
5-
* @phpversion 7
65
*/
76

87
declare(strict_types=1);
@@ -31,4 +30,4 @@ $res[] = ClassType::from(new class extends Class1 {
3130
function a() {}
3231
});
3332

34-
Assert::matchFile(__DIR__ . '/ClassType.from.php7.expect', implode("\n", $res));
33+
Assert::matchFile(__DIR__ . '/ClassType.from.anonymous.expect', implode("\n", $res));

tests/PhpGenerator/Helpers.dump().php7.phpt

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/PhpGenerator/Helpers.dump().phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Assert::same('FALSE', Helpers::dump(FALSE));
2929

3030
Assert::same("''", Helpers::dump(''));
3131
Assert::same("'Hello'", Helpers::dump('Hello'));
32-
Assert::same("'I\xc3\xb1t\xc3\xabrn\xc3\xa2ti\xc3\xb4n\xc3\xa0liz\xc3\xa6ti\xc3\xb8n'", Helpers::dump("I\xc3\xb1t\xc3\xabrn\xc3\xa2ti\xc3\xb4n\xc3\xa0liz\xc3\xa6ti\xc3\xb8n")); // Iñtërnâtiônàlizætiøn
32+
Assert::same("'I\u{F1}t\u{EB}rn\u{E2}ti\u{F4}n\u{E0}liz\u{E6}ti\u{F8}n'", Helpers::dump("I\u{F1}t\u{EB}rn\u{E2}ti\u{F4}n\u{E0}liz\u{E6}ti\u{F8}n")); // Iñtërnâtiônàlizætiøn
3333
Assert::same('"\rHello \$"', Helpers::dump("\rHello $"));
3434
Assert::same("'He\\llo'", Helpers::dump('He\llo'));
3535
Assert::same('\'He\ll\\\\\o \\\'wor\\\\\\\'ld\\\\\'', Helpers::dump('He\ll\\\o \'wor\\\'ld\\'));
@@ -114,3 +114,7 @@ Assert::match(
114114
"Nette\\PhpGenerator\\Helpers::createObject('TestDateTime', %A%)",
115115
Helpers::dump(new TestDateTime('2016-06-22 20:52:43.1234', new DateTimeZone('Europe/Prague')))
116116
);
117+
118+
Assert::exception(function () {
119+
Helpers::dump(new class {});
120+
}, Nette\InvalidArgumentException::class, 'Cannot dump anonymous class.');

tests/PhpGenerator/Method.returnTypes.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Test: Nette\PhpGenerator - PHP7 return type declarations
5-
* @phpversion 7.0
65
*/
76

87
declare(strict_types=1);

tests/PhpGenerator/Method.scalarParameters.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Test: Nette\PhpGenerator - PHP7 scalar type hints
5-
* @phpversion 7.0
65
*/
76

87
declare(strict_types=1);

tests/PhpGenerator/Method.variadics.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Test: Nette\PhpGenerator & variadics.
5-
* @phpversion 5.6
65
*/
76

87
declare(strict_types=1);

0 commit comments

Comments
 (0)