Issue #1509968 by dcam, tobiassjosten: Consistently use count() instead of sizeof() alias.

8.0.x
Dries 2012-09-18 16:00:36 +02:00
parent cf40686a77
commit 8c8e2264c0
2 changed files with 3 additions and 3 deletions

View File

@ -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:') . '<pre>' . print_r($mail, TRUE) . '</pre>');
}

View File

@ -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');