mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
[ticket/14972] replace all occurrences of sizeof() with the count()
PHPBB3-14972
This commit is contained in:
@@ -229,7 +229,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
||||
{
|
||||
// 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)))
|
||||
if (count(array_diff($one, $two)) || count(array_diff($two, $one)))
|
||||
{
|
||||
// get a nice error message
|
||||
$this->assertEquals($one, $two);
|
||||
|
@@ -621,7 +621,7 @@ class phpbb_database_test_connection_manager
|
||||
}
|
||||
|
||||
// Combine all of the SETVALs into one query
|
||||
if (sizeof($setval_queries))
|
||||
if (count($setval_queries))
|
||||
{
|
||||
$queries[] = 'SELECT ' . implode(', ', $setval_queries);
|
||||
}
|
||||
|
@@ -425,7 +425,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
$meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
|
||||
|
||||
// Wait for extension to be fully enabled
|
||||
while (sizeof($meta_refresh))
|
||||
while (count($meta_refresh))
|
||||
{
|
||||
preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match);
|
||||
$url = $match[1];
|
||||
@@ -987,7 +987,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
|
||||
$this->assertEquals(
|
||||
1,
|
||||
sizeof($result),
|
||||
count($result),
|
||||
$message ?: 'Failed asserting that exactly one checkbox with name' .
|
||||
" $name exists in crawler scope."
|
||||
);
|
||||
|
@@ -317,7 +317,7 @@ class phpbb_ui_test_case extends phpbb_test_case
|
||||
$meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]');
|
||||
|
||||
// Wait for extension to be fully enabled
|
||||
while (sizeof($meta_refresh))
|
||||
while (count($meta_refresh))
|
||||
{
|
||||
preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match);
|
||||
$this->getDriver()->execute(array('method' => 'post', 'url' => $match[1]));
|
||||
|
Reference in New Issue
Block a user