From a18e7ae7c382dda622858c3726dd9c59857329ce Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 28 Feb 2016 19:55:48 +0000 Subject: [PATCH] Ad a unit test for `bool_from_yn()`. Props borgesbruno. Fixes #35972. git-svn-id: https://develop.svn.wordpress.org/trunk@36764 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 631b303e70..36701a7fb2 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -73,6 +73,15 @@ class Tests_Functions extends WP_UnitTestCase { $this->assertFalse(size_format(array())); } + /** + * @ticket 35972 + */ + function test_bool_from_yn() { + $this->assertTrue( bool_from_yn( 'Y' ) ); + $this->assertTrue( bool_from_yn( 'y' ) ); + $this->assertFalse( bool_from_yn( 'n' ) ); + } + function test_path_is_absolute() { if ( !is_callable('path_is_absolute') ) $this->markTestSkipped();