diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-11-27 08:08:34 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-11-27 08:49:06 -0500 |
commit | 3ed4fc437e2a88638d705b8f4cab23eacf39fe3c (patch) | |
tree | cb77a3fa4f455a2351db925d34e5de1289fe580b | |
parent | d308ee8a25ec6dc7b6e23cb78e14bd1d75f05a91 (diff) | |
download | forums-3ed4fc437e2a88638d705b8f4cab23eacf39fe3c.tar forums-3ed4fc437e2a88638d705b8f4cab23eacf39fe3c.tar.gz forums-3ed4fc437e2a88638d705b8f4cab23eacf39fe3c.tar.bz2 forums-3ed4fc437e2a88638d705b8f4cab23eacf39fe3c.tar.xz forums-3ed4fc437e2a88638d705b8f4cab23eacf39fe3c.zip |
[ticket/11174] Move assertion definition to base class.
PHPBB3-11174
-rw-r--r-- | tests/search/native_test.php | 16 | ||||
-rw-r--r-- | tests/test_framework/phpbb_database_test_case.php | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/tests/search/native_test.php b/tests/search/native_test.php index 5f6d49c26c..21cbde496a 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -175,20 +175,4 @@ class phpbb_search_native_test extends phpbb_database_test_case } $this->assert_array_content_equals($common, $this->search->get_common_words()); } - - public function assert_array_content_equals($one, $two) - { - // http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important - // but one array_diff is not enough! - if (sizeof(array_diff($one, $two)) || sizeof(array_diff($two, $one))) - { - // get a nice error message - $this->assertEquals($one, $two); - } - else - { - // increase assertion count - $this->assertTrue(true); - } - } } diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index 75a3c0944b..514619687a 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -141,4 +141,20 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test { return $matches[1] . strtoupper($matches[2]) . $matches[3]; } + + public function assert_array_content_equals($one, $two) + { + // http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important + // but one array_diff is not enough! + if (sizeof(array_diff($one, $two)) || sizeof(array_diff($two, $one))) + { + // get a nice error message + $this->assertEquals($one, $two); + } + else + { + // increase assertion count + $this->assertTrue(true); + } + } } |