From 8c8e2264c0525c121830eab981aa090a350c6abe Mon Sep 17 00:00:00 2001 From: Dries Date: Tue, 18 Sep 2012 16:00:36 +0200 Subject: [PATCH] Issue #1509968 by dcam, tobiassjosten: Consistently use count() instead of sizeof() alias. --- core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php | 4 ++-- .../Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 10501d0a30f..385d6f4586a 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -2747,7 +2747,7 @@ abstract class WebTestBase extends TestBase { protected function assertMailString($field_name, $string, $email_depth) { $mails = $this->drupalGetMails(); $string_found = FALSE; - for ($i = sizeof($mails) -1; $i >= sizeof($mails) - $email_depth && $i >= 0; $i--) { + for ($i = count($mails) -1; $i >= count($mails) - $email_depth && $i >= 0; $i--) { $mail = $mails[$i]; // Normalize whitespace, as we don't know what the mail system might have // done. Any run of whitespace becomes a single space. @@ -2787,7 +2787,7 @@ abstract class WebTestBase extends TestBase { */ protected function verboseEmail($count = 1) { $mails = $this->drupalGetMails(); - for ($i = sizeof($mails) -1; $i >= sizeof($mails) - $count && $i >= 0; $i--) { + for ($i = count($mails) -1; $i >= count($mails) - $count && $i >= 0; $i--) { $mail = $mails[$i]; $this->verbose(t('Email:') . '
' . print_r($mail, TRUE) . '
'); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php index c8bd41e829d..37cbf4ee35a 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php @@ -121,7 +121,7 @@ class TermFieldMultipleVocabularyTest extends TaxonomyTestBase { // Verify that field and instance settings are correct. $field_info = field_info_field($this->field_name); - $this->assertEqual(sizeof($field_info['settings']['allowed_values']), 1, 'Only one vocabulary is allowed for the field.'); + $this->assertEqual(count($field_info['settings']['allowed_values']), 1, 'Only one vocabulary is allowed for the field.'); // The widget should still be displayed. $this->drupalGet('test-entity/add/test_bundle');