Skip to content

Commit 103aabe

Browse files
committed
Add missing extends tests
1 parent 1fabf41 commit 103aabe

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
MongoDB\BSON\Decimal128 cannot be extended
3+
--FILE--
4+
<?php
5+
6+
class MyDecimal128 extends MongoDB\BSON\Decimal128 {}
7+
8+
?>
9+
===DONE===
10+
<?php exit(0); ?>
11+
--EXPECTF--
12+
Fatal error: Class MyDecimal128 may not inherit from final class (MongoDB\BSON\Decimal128) in %s on line %d

tests/command/command_error-001.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
MongoDB\Driver\Command cannot be extended
3+
--FILE--
4+
<?php
5+
6+
class MyCommand extends MongoDB\Driver\Command {}
7+
8+
?>
9+
===DONE===
10+
<?php exit(0); ?>
11+
--EXPECTF--
12+
Fatal error: Class MyCommand may not inherit from final class (MongoDB\Driver\Command) in %s on line %d
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
MongoDB\Driver\WriteConcernError cannot be extended
3+
--FILE--
4+
<?php
5+
6+
class MyWriteConcernError extends MongoDB\Driver\WriteConcernError {}
7+
8+
?>
9+
===DONE===
10+
<?php exit(0); ?>
11+
--EXPECTF--
12+
Fatal error: Class MyWriteConcernError may not inherit from final class (MongoDB\Driver\WriteConcernError) in %s on line %d
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
MongoDB\Driver\WriteError cannot be extended
3+
--FILE--
4+
<?php
5+
6+
class MyWriteError extends MongoDB\Driver\WriteError {}
7+
8+
?>
9+
===DONE===
10+
<?php exit(0); ?>
11+
--EXPECTF--
12+
Fatal error: Class MyWriteError may not inherit from final class (MongoDB\Driver\WriteError) in %s on line %d
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
MongoDB\Driver\WriteResult cannot be extended
3+
--FILE--
4+
<?php
5+
6+
class MyWriteResult extends MongoDB\Driver\WriteResult {}
7+
8+
?>
9+
===DONE===
10+
<?php exit(0); ?>
11+
--EXPECTF--
12+
Fatal error: Class MyWriteResult may not inherit from final class (MongoDB\Driver\WriteResult) in %s on line %d

0 commit comments

Comments
 (0)