From 19645a4790ed501895b554a3edb42d157e16712a Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 21 Jan 2019 00:32:33 +0000 Subject: [PATCH] Tests: Add tests for the `__return*()` functions. Props pbearne, mukesh27. Fixes #46043. git-svn-id: https://develop.svn.wordpress.org/trunk@44658 602fd350-edb4-49c9-b593-d223f7449a82 --- .../tests/functions/underscoreReturn.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/phpunit/tests/functions/underscoreReturn.php diff --git a/tests/phpunit/tests/functions/underscoreReturn.php b/tests/phpunit/tests/functions/underscoreReturn.php new file mode 100644 index 0000000000..8c1d2e0962 --- /dev/null +++ b/tests/phpunit/tests/functions/underscoreReturn.php @@ -0,0 +1,34 @@ +assertTrue( __return_true() ); + } + + public function test__return_false() { + $this->assertFalse( __return_false() ); + } + + public function test__return_zero() { + $this->assertSame( 0, __return_zero() ); + } + + public function test__return_empty_array() { + $this->assertSame( array(), __return_empty_array() ); + } + + public function test__return_null() { + $this->assertNull( __return_null() ); + } + + public function test__return_empty_string() { + $this->assertSame( '', __return_empty_string() ); + } +}