Skip to content

Commit

Permalink
Add more tests covering deprecation of _ as CE name
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Aug 13, 2024
1 parent e0f6e3d commit 5622def
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Zend/tests/enum/enum_underscore_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "_" as a enum name is deprecated
--FILE--
<?php

namespace Foo\Bar {
enum _ {}
}

namespace {
enum _ {}
}

?>
--EXPECTF--
Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d

Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/interface_underscore_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "_" as an interface name is deprecated
--FILE--
<?php

namespace Foo\Bar {
interface _ {}
}

namespace {
interface _ {}
}

?>
--EXPECTF--
Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d

Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/traits/enum_underscore_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "_" as a trait name is deprecated
--FILE--
<?php

namespace Foo\Bar {
trait _ {}
}

namespace {
trait _ {}
}

?>
--EXPECTF--
Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d

Deprecated: Using "_" as a class name is deprecated since 8.4 in %s on line %d

0 comments on commit 5622def

Please sign in to comment.