summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorJennifer Hodgdon <yahgrp@poplarware.com>2013-02-26 10:53:43 -0800
committerJennifer Hodgdon <yahgrp@poplarware.com>2013-02-26 10:53:43 -0800
commit7d76caba565621d39574867663b21f2aa15467b2 (patch)
tree075897d0a0d3f03e85414063e1f33932a0eb428d /modules/simpletest
parentb822ac338ad4ace7e354c51565605b43fb4539b7 (diff)
downloadbrdo-7d76caba565621d39574867663b21f2aa15467b2.tar.gz
brdo-7d76caba565621d39574867663b21f2aa15467b2.tar.bz2
Issue #1794012 by dcam, Crell, Lars Toomre: Remove t() from asserts in database system tests
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/database_test.test690
1 files changed, 345 insertions, 345 deletions
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index 2c096fb1d..0b2b1c699 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -48,7 +48,7 @@ class DatabaseTestCase extends DrupalWebTestCase {
}
foreach ($schema as $name => $data) {
- $this->assertTrue(db_table_exists($name), t('Table @name created successfully.', array('@name' => $name)));
+ $this->assertTrue(db_table_exists($name), format_string('Table @name created successfully.', array('@name' => $name)));
}
}
@@ -191,25 +191,25 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
$db1 = Database::getConnection('default', 'default');
$db2 = Database::getConnection('slave', 'default');
- $this->assertNotNull($db1, t('default connection is a real connection object.'));
- $this->assertNotNull($db2, t('slave connection is a real connection object.'));
- $this->assertNotIdentical($db1, $db2, t('Each target refers to a different connection.'));
+ $this->assertNotNull($db1, 'default connection is a real connection object.');
+ $this->assertNotNull($db2, 'slave connection is a real connection object.');
+ $this->assertNotIdentical($db1, $db2, 'Each target refers to a different connection.');
// Try to open those targets another time, that should return the same objects.
$db1b = Database::getConnection('default', 'default');
$db2b = Database::getConnection('slave', 'default');
- $this->assertIdentical($db1, $db1b, t('A second call to getConnection() returns the same object.'));
- $this->assertIdentical($db2, $db2b, t('A second call to getConnection() returns the same object.'));
+ $this->assertIdentical($db1, $db1b, 'A second call to getConnection() returns the same object.');
+ $this->assertIdentical($db2, $db2b, 'A second call to getConnection() returns the same object.');
// Try to open an unknown target.
$unknown_target = $this->randomName();
$db3 = Database::getConnection($unknown_target, 'default');
- $this->assertNotNull($db3, t('Opening an unknown target returns a real connection object.'));
- $this->assertIdentical($db1, $db3, t('An unknown target opens the default connection.'));
+ $this->assertNotNull($db3, 'Opening an unknown target returns a real connection object.');
+ $this->assertIdentical($db1, $db3, 'An unknown target opens the default connection.');
// Try to open that unknown target another time, that should return the same object.
$db3b = Database::getConnection($unknown_target, 'default');
- $this->assertIdentical($db3, $db3b, t('A second call to getConnection() returns the same object.'));
+ $this->assertIdentical($db3, $db3b, 'A second call to getConnection() returns the same object.');
}
/**
@@ -227,7 +227,7 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
$db1 = Database::getConnection('default', 'default');
$db2 = Database::getConnection('slave', 'default');
- $this->assertIdentical($db1, $db2, t('Both targets refer to the same connection.'));
+ $this->assertIdentical($db1, $db2, 'Both targets refer to the same connection.');
}
/**
@@ -242,7 +242,7 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
$db2 = Database::getConnection('default', 'default');
// Opening a connection after closing it should yield an object different than the original.
- $this->assertNotIdentical($db1, $db2, t('Opening the default connection after it is closed returns a new object.'));
+ $this->assertNotIdentical($db1, $db2, 'Opening the default connection after it is closed returns a new object.');
}
/**
@@ -257,8 +257,8 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
// In the MySQL driver, the port can be different, so check individual
// options.
- $this->assertEqual($connection_info['default']['driver'], $connectionOptions['driver'], t('The default connection info driver matches the current connection options driver.'));
- $this->assertEqual($connection_info['default']['database'], $connectionOptions['database'], t('The default connection info database matches the current connection options database.'));
+ $this->assertEqual($connection_info['default']['driver'], $connectionOptions['driver'], 'The default connection info driver matches the current connection options driver.');
+ $this->assertEqual($connection_info['default']['database'], $connectionOptions['database'], 'The default connection info database matches the current connection options database.');
// Set up identical slave and confirm connection options are identical.
Database::addConnectionInfo('default', 'slave', $connection_info['default']);
@@ -267,7 +267,7 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
// Get a fresh copy of the default connection options.
$connectionOptions = $db->getConnectionOptions();
- $this->assertIdentical($connectionOptions, $connectionOptions2, t('The default and slave connection options are identical.'));
+ $this->assertIdentical($connectionOptions, $connectionOptions2, 'The default and slave connection options are identical.');
// Set up a new connection with different connection info.
$test = $connection_info['default'];
@@ -277,7 +277,7 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
// Get a fresh copy of the default connection options.
$connectionOptions = $db->getConnectionOptions();
- $this->assertNotEqual($connection_info['default']['database'], $connectionOptions['database'], t('The test connection info database does not match the current connection options database.'));
+ $this->assertNotEqual($connection_info['default']['database'], $connectionOptions['database'], 'The test connection info database does not match the current connection options database.');
}
}
@@ -302,14 +302,14 @@ class DatabaseFetchTestCase extends DatabaseTestCase {
function testQueryFetchDefault() {
$records = array();
$result = db_query('SELECT name FROM {test} WHERE age = :age', array(':age' => 25));
- $this->assertTrue($result instanceof DatabaseStatementInterface, t('Result set is a Drupal statement object.'));
+ $this->assertTrue($result instanceof DatabaseStatementInterface, 'Result set is a Drupal statement object.');
foreach ($result as $record) {
$records[] = $record;
- $this->assertTrue(is_object($record), t('Record is an object.'));
- $this->assertIdentical($record->name, 'John', t('25 year old is John.'));
+ $this->assertTrue(is_object($record), 'Record is an object.');
+ $this->assertIdentical($record->name, 'John', '25 year old is John.');
}
- $this->assertIdentical(count($records), 1, t('There is only one record.'));
+ $this->assertIdentical(count($records), 1, 'There is only one record.');
}
/**
@@ -320,11 +320,11 @@ class DatabaseFetchTestCase extends DatabaseTestCase {
$result = db_query('SELECT name FROM {test} WHERE age = :age', array(':age' => 25), array('fetch' => PDO::FETCH_OBJ));
foreach ($result as $record) {
$records[] = $record;
- $this->assertTrue(is_object($record), t('Record is an object.'));
- $this->assertIdentical($record->name, 'John', t('25 year old is John.'));
+ $this->assertTrue(is_object($record), 'Record is an object.');
+ $this->assertIdentical($record->name, 'John', '25 year old is John.');
}
- $this->assertIdentical(count($records), 1, t('There is only one record.'));
+ $this->assertIdentical(count($records), 1, 'There is only one record.');
}
/**
@@ -335,12 +335,12 @@ class DatabaseFetchTestCase extends DatabaseTestCase {
$result = db_query('SELECT name FROM {test} WHERE age = :age', array(':age' => 25), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $record) {
$records[] = $record;
- if ($this->assertTrue(is_array($record), t('Record is an array.'))) {
- $this->assertIdentical($record['name'], 'John', t('Record can be accessed associatively.'));
+ if ($this->assertTrue(is_array($record), 'Record is an array.')) {
+ $this->assertIdentical($record['name'], 'John', 'Record can be accessed associatively.');
}
}
- $this->assertIdentical(count($records), 1, t('There is only one record.'));
+ $this->assertIdentical(count($records), 1, 'There is only one record.');
}
/**
@@ -353,12 +353,12 @@ class DatabaseFetchTestCase extends DatabaseTestCase {
$result = db_query('SELECT name FROM {test} WHERE age = :age', array(':age' => 25), array('fetch' => 'FakeRecord'));
foreach ($result as $record) {
$records[] = $record;
- if ($this->assertTrue($record instanceof FakeRecord, t('Record is an object of class FakeRecord.'))) {
- $this->assertIdentical($record->name, 'John', t('25 year old is John.'));
+ if ($this->assertTrue($record instanceof FakeRecord, 'Record is an object of class FakeRecord.')) {
+ $this->assertIdentical($record->name, 'John', '25 year old is John.');
}
}
- $this->assertIdentical(count($records), 1, t('There is only one record.'));
+ $this->assertIdentical(count($records), 1, 'There is only one record.');
}
}
@@ -387,8 +387,8 @@ class DatabaseFetch2TestCase extends DatabaseTestCase {
$result = db_query('SELECT name FROM {test} WHERE age = :age', array(':age' => 25), array('fetch' => PDO::FETCH_NUM));
foreach ($result as $record) {
$records[] = $record;
- if ($this->assertTrue(is_array($record), t('Record is an array.'))) {
- $this->assertIdentical($record[0], 'John', t('Record can be accessed numerically.'));
+ if ($this->assertTrue(is_array($record), 'Record is an array.')) {
+ $this->assertIdentical($record[0], 'John', 'Record can be accessed numerically.');
}
}
@@ -403,13 +403,13 @@ class DatabaseFetch2TestCase extends DatabaseTestCase {
$result = db_query('SELECT name FROM {test} WHERE age = :age', array(':age' => 25), array('fetch' => PDO::FETCH_BOTH));
foreach ($result as $record) {
$records[] = $record;
- if ($this->assertTrue(is_array($record), t('Record is an array.'))) {
- $this->assertIdentical($record[0], 'John', t('Record can be accessed numerically.'));
- $this->assertIdentical($record['name'], 'John', t('Record can be accessed associatively.'));
+ if ($this->assertTrue(is_array($record), 'Record is an array.')) {
+ $this->assertIdentical($record[0], 'John', 'Record can be accessed numerically.');
+ $this->assertIdentical($record['name'], 'John', 'Record can be accessed associatively.');
}
}
- $this->assertIdentical(count($records), 1, t('There is only one record.'));
+ $this->assertIdentical(count($records), 1, 'There is only one record.');
}
/**
@@ -419,12 +419,12 @@ class DatabaseFetch2TestCase extends DatabaseTestCase {
$records = array();
$result = db_query('SELECT name FROM {test} WHERE age > :age', array(':age' => 25));
$column = $result->fetchCol();
- $this->assertIdentical(count($column), 3, t('fetchCol() returns the right number of records.'));
+ $this->assertIdentical(count($column), 3, 'fetchCol() returns the right number of records.');
$result = db_query('SELECT name FROM {test} WHERE age > :age', array(':age' => 25));
$i = 0;
foreach ($result as $record) {
- $this->assertIdentical($record->name, $column[$i++], t('Column matches direct accesss.'));
+ $this->assertIdentical($record->name, $column[$i++], 'Column matches direct accesss.');
}
}
}
@@ -456,9 +456,9 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
$query->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical($num_records_before + 1, (int) $num_records_after, t('Record inserts correctly.'));
+ $this->assertIdentical($num_records_before + 1, (int) $num_records_after, 'Record inserts correctly.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Yoko'))->fetchField();
- $this->assertIdentical($saved_age, '29', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '29', 'Can retrieve after inserting.');
}
/**
@@ -485,13 +485,13 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
$query->execute();
$num_records_after = (int) db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical($num_records_before + 3, $num_records_after, t('Record inserts correctly.'));
+ $this->assertIdentical($num_records_before + 3, $num_records_after, 'Record inserts correctly.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Larry'))->fetchField();
- $this->assertIdentical($saved_age, '30', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '30', 'Can retrieve after inserting.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Curly'))->fetchField();
- $this->assertIdentical($saved_age, '31', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '31', 'Can retrieve after inserting.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Moe'))->fetchField();
- $this->assertIdentical($saved_age, '32', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '32', 'Can retrieve after inserting.');
}
/**
@@ -520,13 +520,13 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
$query->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical((int) $num_records_before + 3, (int) $num_records_after, t('Record inserts correctly.'));
+ $this->assertIdentical((int) $num_records_before + 3, (int) $num_records_after, 'Record inserts correctly.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Larry'))->fetchField();
- $this->assertIdentical($saved_age, '30', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '30', 'Can retrieve after inserting.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Curly'))->fetchField();
- $this->assertIdentical($saved_age, '31', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '31', 'Can retrieve after inserting.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Moe'))->fetchField();
- $this->assertIdentical($saved_age, '32', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '32', 'Can retrieve after inserting.');
}
/**
@@ -542,11 +542,11 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
->values(array('Moe', '32'))
->execute();
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Larry'))->fetchField();
- $this->assertIdentical($saved_age, '30', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '30', 'Can retrieve after inserting.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Curly'))->fetchField();
- $this->assertIdentical($saved_age, '31', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '31', 'Can retrieve after inserting.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Moe'))->fetchField();
- $this->assertIdentical($saved_age, '32', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '32', 'Can retrieve after inserting.');
}
/**
@@ -560,7 +560,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
))
->execute();
- $this->assertIdentical($id, '5', t('Auto-increment ID returned successfully.'));
+ $this->assertIdentical($id, '5', 'Auto-increment ID returned successfully.');
}
/**
@@ -586,7 +586,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
->execute();
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Meredith'))->fetchField();
- $this->assertIdentical($saved_age, '30', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '30', 'Can retrieve after inserting.');
}
}
@@ -608,12 +608,12 @@ class DatabaseInsertLOBTestCase extends DatabaseTestCase {
*/
function testInsertOneBlob() {
$data = "This is\000a test.";
- $this->assertTrue(strlen($data) === 15, t('Test data contains a NULL.'));
+ $this->assertTrue(strlen($data) === 15, 'Test data contains a NULL.');
$id = db_insert('test_one_blob')
->fields(array('blob1' => $data))
->execute();
$r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', array(':id' => $id))->fetchAssoc();
- $this->assertTrue($r['blob1'] === $data, t('Can insert a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
+ $this->assertTrue($r['blob1'] === $data, format_string('Can insert a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
}
/**
@@ -627,7 +627,7 @@ class DatabaseInsertLOBTestCase extends DatabaseTestCase {
))
->execute();
$r = db_query('SELECT * FROM {test_two_blobs} WHERE id = :id', array(':id' => $id))->fetchAssoc();
- $this->assertTrue($r['blob1'] === 'This is' && $r['blob2'] === 'a test', t('Can insert multiple blobs per row.'));
+ $this->assertTrue($r['blob1'] === 'This is' && $r['blob2'] === 'a test', 'Can insert multiple blobs per row.');
}
}
@@ -654,7 +654,7 @@ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase {
$schema = drupal_get_schema('test');
$job = db_query('SELECT job FROM {test} WHERE id = :id', array(':id' => $id))->fetchField();
- $this->assertEqual($job, $schema['fields']['job']['default'], t('Default field value is set.'));
+ $this->assertEqual($job, $schema['fields']['job']['default'], 'Default field value is set.');
}
/**
@@ -666,13 +666,13 @@ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase {
try {
$result = db_insert('test')->execute();
// This is only executed if no exception has been thrown.
- $this->fail(t('Expected exception NoFieldsException has not been thrown.'));
+ $this->fail('Expected exception NoFieldsException has not been thrown.');
} catch (NoFieldsException $e) {
- $this->pass(t('Expected exception NoFieldsException has been thrown.'));
+ $this->pass('Expected exception NoFieldsException has been thrown.');
}
$num_records_after = (int) db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical($num_records_before, $num_records_after, t('Do nothing as no fields are specified.'));
+ $this->assertIdentical($num_records_before, $num_records_after, 'Do nothing as no fields are specified.');
}
/**
@@ -687,7 +687,7 @@ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase {
$schema = drupal_get_schema('test');
$job = db_query('SELECT job FROM {test} WHERE id = :id', array(':id' => $id))->fetchField();
- $this->assertEqual($job, $schema['fields']['job']['default'], t('Default field value is set.'));
+ $this->assertEqual($job, $schema['fields']['job']['default'], 'Default field value is set.');
}
}
@@ -712,10 +712,10 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
->fields(array('name' => 'Tiffany'))
->condition('id', 1)
->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$saved_name = db_query('SELECT name FROM {test} WHERE id = :id', array(':id' => 1))->fetchField();
- $this->assertIdentical($saved_name, 'Tiffany', t('Updated name successfully.'));
+ $this->assertIdentical($saved_name, 'Tiffany', 'Updated name successfully.');
}
/**
@@ -727,10 +727,10 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
->fields(array('age' => NULL))
->condition('name', 'Kermit')
->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$saved_age = db_query('SELECT age FROM {test_null} WHERE name = :name', array(':name' => 'Kermit'))->fetchField();
- $this->assertNull($saved_age, t('Updated name successfully.'));
+ $this->assertNull($saved_age, 'Updated name successfully.');
}
/**
@@ -741,10 +741,10 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->condition('job', 'Singer')
->execute();
- $this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
+ $this->assertIdentical($num_updated, 2, 'Updated 2 records.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '2', 'Updated fields successfully.');
}
/**
@@ -755,10 +755,10 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->condition('age', 26, '>')
->execute();
- $this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
+ $this->assertIdentical($num_updated, 2, 'Updated 2 records.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '2', 'Updated fields successfully.');
}
/**
@@ -769,10 +769,10 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->where('age > :age', array(':age' => 26))
->execute();
- $this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
+ $this->assertIdentical($num_updated, 2, 'Updated 2 records.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '2', 'Updated fields successfully.');
}
/**
@@ -784,10 +784,10 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
->where('age > :age', array(':age' => 26))
->condition('name', 'Ringo');
$num_updated = $update->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '1', 'Updated fields successfully.');
}
/**
@@ -807,7 +807,7 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
$num_rows = db_update('test')
->expression('age', 'age * age')
->execute();
- $this->assertIdentical($num_rows, 3, t('Number of affected rows are returned.'));
+ $this->assertIdentical($num_rows, 3, 'Number of affected rows are returned.');
}
}
@@ -835,10 +835,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->condition('name', 'Paul')
);
$num_updated = $update->execute();
- $this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
+ $this->assertIdentical($num_updated, 2, 'Updated 2 records.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '2', 'Updated fields successfully.');
}
/**
@@ -849,10 +849,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->condition('name', array('John', 'Paul'), 'IN')
->execute();
- $this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
+ $this->assertIdentical($num_updated, 2, 'Updated 2 records.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '2', 'Updated fields successfully.');
}
/**
@@ -865,10 +865,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->condition('name', array('John', 'Paul', 'George'), 'NoT IN')
->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '1', 'Updated fields successfully.');
}
/**
@@ -879,10 +879,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->condition('age', array(25, 26), 'BETWEEN')
->execute();
- $this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
+ $this->assertIdentical($num_updated, 2, 'Updated 2 records.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '2', 'Updated fields successfully.');
}
/**
@@ -893,10 +893,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->condition('name', '%ge%', 'LIKE')
->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '1', 'Updated fields successfully.');
}
/**
@@ -910,15 +910,15 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->fields(array('job' => 'Musician'))
->expression('age', 'age + :age', array(':age' => 4))
->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$num_matches = db_query('SELECT COUNT(*) FROM {test} WHERE job = :job', array(':job' => 'Musician'))->fetchField();
- $this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
+ $this->assertIdentical($num_matches, '1', 'Updated fields successfully.');
$person = db_query('SELECT * FROM {test} WHERE name = :name', array(':name' => 'Ringo'))->fetch();
- $this->assertEqual($person->name, 'Ringo', t('Name set correctly.'));
- $this->assertEqual($person->age, $before_age + 4, t('Age set correctly.'));
- $this->assertEqual($person->job, 'Musician', t('Job set correctly.'));
+ $this->assertEqual($person->name, 'Ringo', 'Name set correctly.');
+ $this->assertEqual($person->age, $before_age + 4, 'Age set correctly.');
+ $this->assertEqual($person->job, 'Musician', 'Job set correctly.');
$GLOBALS['larry_test'] = 0;
}
@@ -931,10 +931,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->condition('name', 'Ringo')
->expression('age', 'age + :age', array(':age' => 4))
->execute();
- $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+ $this->assertIdentical($num_updated, 1, 'Updated 1 record.');
$after_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Ringo'))->fetchField();
- $this->assertEqual($before_age + 4, $after_age, t('Age updated correctly'));
+ $this->assertEqual($before_age + 4, $after_age, 'Age updated correctly');
}
}
@@ -956,7 +956,7 @@ class DatabaseUpdateLOBTestCase extends DatabaseTestCase {
*/
function testUpdateOneBlob() {
$data = "This is\000a test.";
- $this->assertTrue(strlen($data) === 15, t('Test data contains a NULL.'));
+ $this->assertTrue(strlen($data) === 15, 'Test data contains a NULL.');
$id = db_insert('test_one_blob')
->fields(array('blob1' => $data))
->execute();
@@ -968,7 +968,7 @@ class DatabaseUpdateLOBTestCase extends DatabaseTestCase {
->execute();
$r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', array(':id' => $id))->fetchAssoc();
- $this->assertTrue($r['blob1'] === $data, t('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
+ $this->assertTrue($r['blob1'] === $data, format_string('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
}
/**
@@ -988,7 +988,7 @@ class DatabaseUpdateLOBTestCase extends DatabaseTestCase {
->execute();
$r = db_query('SELECT * FROM {test_two_blobs} WHERE id = :id', array(':id' => $id))->fetchAssoc();
- $this->assertTrue($r['blob1'] === 'and so' && $r['blob2'] === 'is this', t('Can update multiple blobs per row.'));
+ $this->assertTrue($r['blob1'] === 'and so' && $r['blob2'] === 'is this', 'Can update multiple blobs per row.');
}
}
@@ -1028,10 +1028,10 @@ class DatabaseDeleteTruncateTestCase extends DatabaseTestCase {
->condition('pid', $subquery, 'IN');
$num_deleted = $delete->execute();
- $this->assertEqual($num_deleted, 1, t("Deleted 1 record."));
+ $this->assertEqual($num_deleted, 1, "Deleted 1 record.");
$num_records_after = db_query('SELECT COUNT(*) FROM {test_task}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after + $num_deleted, t('Deletion adds up.'));
+ $this->assertEqual($num_records_before, $num_records_after + $num_deleted, 'Deletion adds up.');
}
/**
@@ -1043,10 +1043,10 @@ class DatabaseDeleteTruncateTestCase extends DatabaseTestCase {
$num_deleted = db_delete('test')
->condition('id', 1)
->execute();
- $this->assertIdentical($num_deleted, 1, t('Deleted 1 record.'));
+ $this->assertIdentical($num_deleted, 1, 'Deleted 1 record.');
$num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after + $num_deleted, t('Deletion adds up.'));
+ $this->assertEqual($num_records_before, $num_records_after + $num_deleted, 'Deletion adds up.');
}
/**
@@ -1058,7 +1058,7 @@ class DatabaseDeleteTruncateTestCase extends DatabaseTestCase {
db_truncate('test')->execute();
$num_records_after = db_query("SELECT COUNT(*) FROM {test}")->fetchField();
- $this->assertEqual(0, $num_records_after, t('Truncate really deletes everything.'));
+ $this->assertEqual(0, $num_records_after, 'Truncate really deletes everything.');
}
}
@@ -1089,15 +1089,15 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
))
->execute();
- $this->assertEqual($result, MergeQuery::STATUS_INSERT, t('Insert status returned.'));
+ $this->assertEqual($result, MergeQuery::STATUS_INSERT, 'Insert status returned.');
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before + 1, $num_records_after, t('Merge inserted properly.'));
+ $this->assertEqual($num_records_before + 1, $num_records_after, 'Merge inserted properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Presenter'))->fetch();
- $this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
- $this->assertEqual($person->age, 31, t('Age set correctly.'));
- $this->assertEqual($person->job, 'Presenter', t('Job set correctly.'));
+ $this->assertEqual($person->name, 'Tiffany', 'Name set correctly.');
+ $this->assertEqual($person->age, 31, 'Age set correctly.');
+ $this->assertEqual($person->job, 'Presenter', 'Job set correctly.');
}
/**
@@ -1114,15 +1114,15 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
))
->execute();
- $this->assertEqual($result, MergeQuery::STATUS_UPDATE, t('Update status returned.'));
+ $this->assertEqual($result, MergeQuery::STATUS_UPDATE, 'Update status returned.');
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
+ $this->assertEqual($num_records_before, $num_records_after, 'Merge updated properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Speaker'))->fetch();
- $this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
- $this->assertEqual($person->age, 31, t('Age set correctly.'));
- $this->assertEqual($person->job, 'Speaker', t('Job set correctly.'));
+ $this->assertEqual($person->name, 'Tiffany', 'Name set correctly.');
+ $this->assertEqual($person->age, 31, 'Age set correctly.');
+ $this->assertEqual($person->job, 'Speaker', 'Job set correctly.');
}
/**
@@ -1138,12 +1138,12 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
+ $this->assertEqual($num_records_before, $num_records_after, 'Merge updated properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Speaker'))->fetch();
- $this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
- $this->assertEqual($person->age, 30, t('Age skipped correctly.'));
- $this->assertEqual($person->job, 'Speaker', t('Job set correctly.'));
+ $this->assertEqual($person->name, 'Tiffany', 'Name set correctly.');
+ $this->assertEqual($person->age, 30, 'Age skipped correctly.');
+ $this->assertEqual($person->job, 'Speaker', 'Job set correctly.');
}
/**
@@ -1164,12 +1164,12 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
+ $this->assertEqual($num_records_before, $num_records_after, 'Merge updated properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Speaker'))->fetch();
- $this->assertEqual($person->name, 'Joe', t('Name set correctly.'));
- $this->assertEqual($person->age, 30, t('Age skipped correctly.'));
- $this->assertEqual($person->job, 'Speaker', t('Job set correctly.'));
+ $this->assertEqual($person->name, 'Joe', 'Name set correctly.');
+ $this->assertEqual($person->age, 30, 'Age skipped correctly.');
+ $this->assertEqual($person->job, 'Speaker', 'Job set correctly.');
}
/**
@@ -1193,12 +1193,12 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
+ $this->assertEqual($num_records_before, $num_records_after, 'Merge updated properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Speaker'))->fetch();
- $this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
- $this->assertEqual($person->age, $age_before + 4, t('Age updated correctly.'));
- $this->assertEqual($person->job, 'Speaker', t('Job set correctly.'));
+ $this->assertEqual($person->name, 'Tiffany', 'Name set correctly.');
+ $this->assertEqual($person->age, $age_before + 4, 'Age updated correctly.');
+ $this->assertEqual($person->job, 'Speaker', 'Job set correctly.');
}
/**
@@ -1212,12 +1212,12 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before + 1, $num_records_after, t('Merge inserted properly.'));
+ $this->assertEqual($num_records_before + 1, $num_records_after, 'Merge inserted properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Presenter'))->fetch();
- $this->assertEqual($person->name, '', t('Name set correctly.'));
- $this->assertEqual($person->age, 0, t('Age set correctly.'));
- $this->assertEqual($person->job, 'Presenter', t('Job set correctly.'));
+ $this->assertEqual($person->name, '', 'Name set correctly.');
+ $this->assertEqual($person->age, 0, 'Age set correctly.');
+ $this->assertEqual($person->job, 'Presenter', 'Job set correctly.');
}
/**
@@ -1231,12 +1231,12 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after, t('Merge skipped properly.'));
+ $this->assertEqual($num_records_before, $num_records_after, 'Merge skipped properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Speaker'))->fetch();
- $this->assertEqual($person->name, 'Meredith', t('Name skipped correctly.'));
- $this->assertEqual($person->age, 30, t('Age skipped correctly.'));
- $this->assertEqual($person->job, 'Speaker', t('Job skipped correctly.'));
+ $this->assertEqual($person->name, 'Meredith', 'Name skipped correctly.');
+ $this->assertEqual($person->age, 30, 'Age skipped correctly.');
+ $this->assertEqual($person->job, 'Speaker', 'Job skipped correctly.');
db_merge('test_people')
->key(array('job' => 'Speaker'))
@@ -1244,12 +1244,12 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test_people}')->fetchField();
- $this->assertEqual($num_records_before, $num_records_after, t('Merge skipped properly.'));
+ $this->assertEqual($num_records_before, $num_records_after, 'Merge skipped properly.');
$person = db_query('SELECT * FROM {test_people} WHERE job = :job', array(':job' => 'Speaker'))->fetch();
- $this->assertEqual($person->name, 'Meredith', t('Name skipped correctly.'));
- $this->assertEqual($person->age, 30, t('Age skipped correctly.'));
- $this->assertEqual($person->job, 'Speaker', t('Job skipped correctly.'));
+ $this->assertEqual($person->name, 'Meredith', 'Name skipped correctly.');
+ $this->assertEqual($person->age, 30, 'Age skipped correctly.');
+ $this->assertEqual($person->job, 'Speaker', 'Job skipped correctly.');
}
/**
@@ -1266,10 +1266,10 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
->execute();
}
catch (InvalidMergeQueryException $e) {
- $this->pass(t('InvalidMergeQueryException thrown for invalid query.'));
+ $this->pass('InvalidMergeQueryException thrown for invalid query.');
return;
}
- $this->fail(t('No InvalidMergeQueryException thrown'));
+ $this->fail('No InvalidMergeQueryException thrown');
}
}
@@ -1300,7 +1300,7 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$num_records++;
}
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
}
/**
@@ -1320,8 +1320,8 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$query = (string)$query;
$expected = "/* Testing query comments */ SELECT test.name AS name, test.age AS age\nFROM \n{test} test";
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
- $this->assertEqual($query, $expected, t('The flattened query contains the comment string.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
+ $this->assertEqual($query, $expected, 'The flattened query contains the comment string.');
}
/**
@@ -1341,8 +1341,8 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$query = (string)$query;
$expected = "/* Testing query comments SELECT nid FROM {node}; -- */ SELECT test.name AS name, test.age AS age\nFROM \n{test} test";
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
- $this->assertEqual($query, $expected, t('The flattened query contains the sanitised comment string.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
+ $this->assertEqual($query, $expected, 'The flattened query contains the sanitised comment string.');
}
/**
@@ -1356,13 +1356,13 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$result = $query->execute();
// Check that the aliases are being created the way we want.
- $this->assertEqual($name_field, 'name', t('Name field alias is correct.'));
- $this->assertEqual($age_field, 'age', t('Age field alias is correct.'));
+ $this->assertEqual($name_field, 'name', 'Name field alias is correct.');
+ $this->assertEqual($age_field, 'age', 'Age field alias is correct.');
// Ensure that we got the right record.
$record = $result->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
- $this->assertEqual($record->$age_field, 27, t('Fetched age is correct.'));
+ $this->assertEqual($record->$name_field, 'George', 'Fetched name is correct.');
+ $this->assertEqual($record->$age_field, 27, 'Fetched age is correct.');
}
/**
@@ -1376,13 +1376,13 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$result = $query->execute();
// Check that the aliases are being created the way we want.
- $this->assertEqual($name_field, 'name', t('Name field alias is correct.'));
- $this->assertEqual($age_field, 'double_age', t('Age field alias is correct.'));
+ $this->assertEqual($name_field, 'name', 'Name field alias is correct.');
+ $this->assertEqual($age_field, 'double_age', 'Age field alias is correct.');
// Ensure that we got the right record.
$record = $result->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
- $this->assertEqual($record->$age_field, 27*2, t('Fetched age expression is correct.'));
+ $this->assertEqual($record->$name_field, 'George', 'Fetched name is correct.');
+ $this->assertEqual($record->$age_field, 27*2, 'Fetched age expression is correct.');
}
/**
@@ -1397,14 +1397,14 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$result = $query->execute();
// Check that the aliases are being created the way we want.
- $this->assertEqual($age_double_field, 'expression', t('Double age field alias is correct.'));
- $this->assertEqual($age_triple_field, 'expression_2', t('Triple age field alias is correct.'));
+ $this->assertEqual($age_double_field, 'expression', 'Double age field alias is correct.');
+ $this->assertEqual($age_triple_field, 'expression_2', 'Triple age field alias is correct.');
// Ensure that we got the right record.
$record = $result->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
- $this->assertEqual($record->$age_double_field, 27*2, t('Fetched double age expression is correct.'));
- $this->assertEqual($record->$age_triple_field, 27*3, t('Fetched triple age expression is correct.'));
+ $this->assertEqual($record->$name_field, 'George', 'Fetched name is correct.');
+ $this->assertEqual($record->$age_double_field, 27*2, 'Fetched double age expression is correct.');
+ $this->assertEqual($record->$age_triple_field, 27*3, 'Fetched triple age expression is correct.');
}
/**
@@ -1417,17 +1417,17 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->execute()->fetchObject();
// Check that all fields we asked for are present.
- $this->assertNotNull($record->id, t('ID field is present.'));
- $this->assertNotNull($record->name, t('Name field is present.'));
- $this->assertNotNull($record->age, t('Age field is present.'));
- $this->assertNotNull($record->job, t('Job field is present.'));
+ $this->assertNotNull($record->id, 'ID field is present.');
+ $this->assertNotNull($record->name, 'Name field is present.');
+ $this->assertNotNull($record->age, 'Age field is present.');
+ $this->assertNotNull($record->job, 'Job field is present.');
// Ensure that we got the right record.
// Check that all fields we asked for are present.
- $this->assertEqual($record->id, 2, t('ID field has the correct value.'));
- $this->assertEqual($record->name, 'George', t('Name field has the correct value.'));
- $this->assertEqual($record->age, 27, t('Age field has the correct value.'));
- $this->assertEqual($record->job, 'Singer', t('Job field has the correct value.'));
+ $this->assertEqual($record->id, 2, 'ID field has the correct value.');
+ $this->assertEqual($record->name, 'George', 'Name field has the correct value.');
+ $this->assertEqual($record->age, 27, 'Age field has the correct value.');
+ $this->assertEqual($record->job, 'Singer', 'Job field has the correct value.');
}
/**
@@ -1440,17 +1440,17 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->execute()->fetchObject();
// Check that all fields we asked for are present.
- $this->assertNotNull($record->id, t('ID field is present.'));
- $this->assertNotNull($record->name, t('Name field is present.'));
- $this->assertNotNull($record->age, t('Age field is present.'));
- $this->assertNotNull($record->job, t('Job field is present.'));
+ $this->assertNotNull($record->id, 'ID field is present.');
+ $this->assertNotNull($record->name, 'Name field is present.');
+ $this->assertNotNull($record->age, 'Age field is present.');
+ $this->assertNotNull($record->job, 'Job field is present.');
// Ensure that we got the right record.
// Check that all fields we asked for are present.
- $this->assertEqual($record->id, 2, t('ID field has the correct value.'));
- $this->assertEqual($record->name, 'George', t('Name field has the correct value.'));
- $this->assertEqual($record->age, 27, t('Age field has the correct value.'));
- $this->assertEqual($record->job, 'Singer', t('Job field has the correct value.'));
+ $this->assertEqual($record->id, 2, 'ID field has the correct value.');
+ $this->assertEqual($record->name, 'George', 'Name field has the correct value.');
+ $this->assertEqual($record->age, 27, 'Age field has the correct value.');
+ $this->assertEqual($record->job, 'Singer', 'Job field has the correct value.');
}
/**
@@ -1464,8 +1464,8 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->isNull('age')
->execute()->fetchCol();
- $this->assertEqual(count($names), 1, t('Correct number of records found with NULL age.'));
- $this->assertEqual($names[0], 'Fozzie', t('Correct record returned for NULL age.'));
+ $this->assertEqual(count($names), 1, 'Correct number of records found with NULL age.');
+ $this->assertEqual($names[0], 'Fozzie', 'Correct record returned for NULL age.');
}
/**
@@ -1480,9 +1480,9 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->orderBy('name')
->execute()->fetchCol();
- $this->assertEqual(count($names), 2, t('Correct number of records found withNOT NULL age.'));
- $this->assertEqual($names[0], 'Gonzo', t('Correct record returned for NOT NULL age.'));
- $this->assertEqual($names[1], 'Kermit', t('Correct record returned for NOT NULL age.'));
+ $this->assertEqual(count($names), 2, 'Correct number of records found withNOT NULL age.');
+ $this->assertEqual($names[0], 'Gonzo', 'Correct record returned for NOT NULL age.');
+ $this->assertEqual($names[1], 'Kermit', 'Correct record returned for NOT NULL age.');
}
/**
@@ -1503,10 +1503,10 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$names = $query_1->execute()->fetchCol();
// Ensure we only get 2 records.
- $this->assertEqual(count($names), 2, t('UNION correctly discarded duplicates.'));
+ $this->assertEqual(count($names), 2, 'UNION correctly discarded duplicates.');
- $this->assertEqual($names[0], 'George', t('First query returned correct name.'));
- $this->assertEqual($names[1], 'Ringo', t('Second query returned correct name.'));
+ $this->assertEqual($names[0], 'George', 'First query returned correct name.');
+ $this->assertEqual($names[1], 'Ringo', 'Second query returned correct name.');
}
/**
@@ -1526,11 +1526,11 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$names = $query_1->execute()->fetchCol();
// Ensure we get all 3 records.
- $this->assertEqual(count($names), 3, t('UNION ALL correctly preserved duplicates.'));
+ $this->assertEqual(count($names), 3, 'UNION ALL correctly preserved duplicates.');
- $this->assertEqual($names[0], 'George', t('First query returned correct first name.'));
- $this->assertEqual($names[1], 'Ringo', t('Second query returned correct second name.'));
- $this->assertEqual($names[2], 'Ringo', t('Third query returned correct name.'));
+ $this->assertEqual($names[0], 'George', 'First query returned correct first name.');
+ $this->assertEqual($names[1], 'Ringo', 'Second query returned correct second name.');
+ $this->assertEqual($names[2], 'Ringo', 'Third query returned correct name.');
}
/**
@@ -1565,7 +1565,7 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->orderBy('id')
->execute()
->fetchCol();
- $this->assertEqual($ordered_ids, $expected_ids, t('A query without random ordering returns IDs in the correct order.'));
+ $this->assertEqual($ordered_ids, $expected_ids, 'A query without random ordering returns IDs in the correct order.');
// Now perform the same query, but instead choose a random ordering. We
// expect this to contain a differently ordered version of the original
@@ -1576,10 +1576,10 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->orderRandom()
->execute()
->fetchCol();
- $this->assertNotEqual($randomized_ids, $ordered_ids, t('A query with random ordering returns an unordered set of IDs.'));
+ $this->assertNotEqual($randomized_ids, $ordered_ids, 'A query with random ordering returns an unordered set of IDs.');
$sorted_ids = $randomized_ids;
sort($sorted_ids);
- $this->assertEqual($sorted_ids, $ordered_ids, t('After sorting the random list, the result matches the original query.'));
+ $this->assertEqual($sorted_ids, $ordered_ids, 'After sorting the random list, the result matches the original query.');
// Now perform the exact same query again, and make sure the order is
// different.
@@ -1589,10 +1589,10 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
->orderRandom()
->execute()
->fetchCol();
- $this->assertNotEqual($randomized_ids_second_set, $randomized_ids, t('Performing the query with random ordering a second time returns IDs in a different order.'));
+ $this->assertNotEqual($randomized_ids_second_set, $randomized_ids, 'Performing the query with random ordering a second time returns IDs in a different order.');
$sorted_ids_second_set = $randomized_ids_second_set;
sort($sorted_ids_second_set);
- $this->assertEqual($sorted_ids_second_set, $sorted_ids, t('After sorting the second random list, the result matches the sorted version of the first random list.'));
+ $this->assertEqual($sorted_ids_second_set, $sorted_ids, 'After sorting the second random list, the result matches the sorted version of the first random list.');
}
/**
@@ -1649,7 +1649,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
// WHERE tt.task = 'code'
$people = $select->execute()->fetchCol();
- $this->assertEqual(count($people), 1, t('Returned the correct number of rows.'));
+ $this->assertEqual(count($people), 1, 'Returned the correct number of rows.');
}
}
@@ -1676,7 +1676,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
// INNER JOIN test t ON t.id=tt.pid
$people = $select->execute()->fetchCol();
- $this->assertEqual(count($people), 1, t('Returned the correct number of rows.'));
+ $this->assertEqual(count($people), 1, 'Returned the correct number of rows.');
}
/**
@@ -1699,7 +1699,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
// FROM test tt2
// WHERE tt2.pid IN (SELECT tt.pid AS pid FROM test_task tt WHERE tt.priority=1)
$people = $select->execute()->fetchCol();
- $this->assertEqual(count($people), 5, t('Returned the correct number of rows.'));
+ $this->assertEqual(count($people), 5, 'Returned the correct number of rows.');
}
/**
@@ -1723,7 +1723,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
// INNER JOIN (SELECT tt.pid AS pid FROM test_task tt WHERE priority=1) tt ON t.id=tt.pid
$people = $select->execute()->fetchCol();
- $this->assertEqual(count($people), 2, t('Returned the correct number of rows.'));
+ $this->assertEqual(count($people), 2, 'Returned the correct number of rows.');
}
/**
@@ -1753,7 +1753,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
// Ensure that we got the right record.
$record = $result->fetch();
- $this->assertEqual($record->name, 'George', t('Fetched name is correct using EXISTS query.'));
+ $this->assertEqual($record->name, 'George', 'Fetched name is correct using EXISTS query.');
}
/**
@@ -1783,7 +1783,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
// Ensure that we got the right number of records.
$people = $query->execute()->fetchCol();
- $this->assertEqual(count($people), 3, t('NOT EXISTS query returned the correct results.'));
+ $this->assertEqual(count($people), 3, 'NOT EXISTS query returned the correct results.');
}
}
@@ -1814,11 +1814,11 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$last_age = 0;
foreach ($result as $record) {
$num_records++;
- $this->assertTrue($record->age >= $last_age, t('Results returned in correct order.'));
+ $this->assertTrue($record->age >= $last_age, 'Results returned in correct order.');
$last_age = $record->age;
}
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
}
/**
@@ -1845,11 +1845,11 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$num_records++;
foreach ($record as $kk => $col) {
if ($expected[$k][$kk] != $results[$k][$kk]) {
- $this->assertTrue(FALSE, t('Results returned in correct order.'));
+ $this->assertTrue(FALSE, 'Results returned in correct order.');
}
}
}
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
}
/**
@@ -1866,11 +1866,11 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$last_age = 100000000;
foreach ($result as $record) {
$num_records++;
- $this->assertTrue($record->age <= $last_age, t('Results returned in correct order.'));
+ $this->assertTrue($record->age <= $last_age, 'Results returned in correct order.');
$last_age = $record->age;
}
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
}
}
@@ -1904,12 +1904,12 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$last_priority = 0;
foreach ($result as $record) {
$num_records++;
- $this->assertTrue($record->$priority_field >= $last_priority, t('Results returned in correct order.'));
- $this->assertNotEqual($record->$name_field, 'Ringo', t('Taskless person not selected.'));
+ $this->assertTrue($record->$priority_field >= $last_priority, 'Results returned in correct order.');
+ $this->assertNotEqual($record->$name_field, 'Ringo', 'Taskless person not selected.');
$last_priority = $record->$priority_field;
}
- $this->assertEqual($num_records, 7, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 7, 'Returned the correct number of rows.');
}
/**
@@ -1930,11 +1930,11 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
foreach ($result as $record) {
$num_records++;
- $this->assertTrue(strcmp($record->$name_field, $last_name) >= 0, t('Results returned in correct order.'));
+ $this->assertTrue(strcmp($record->$name_field, $last_name) >= 0, 'Results returned in correct order.');
$last_priority = $record->$name_field;
}
- $this->assertEqual($num_records, 8, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 8, 'Returned the correct number of rows.');
}
/**
@@ -1953,7 +1953,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$records = array();
foreach ($result as $record) {
$num_records++;
- $this->assertTrue($record->$count_field >= $last_count, t('Results returned in correct order.'));
+ $this->assertTrue($record->$count_field >= $last_count, 'Results returned in correct order.');
$last_count = $record->$count_field;
$records[$record->$task_field] = $record->$count_field;
}
@@ -1967,10 +1967,10 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
);
foreach ($correct_results as $task => $count) {
- $this->assertEqual($records[$task], $count, t("Correct number of '@task' records found.", array('@task' => $task)));
+ $this->assertEqual($records[$task], $count, format_string("Correct number of '@task' records found.", array('@task' => $task)));
}
- $this->assertEqual($num_records, 6, t('Returned the correct number of total rows.'));
+ $this->assertEqual($num_records, 6, 'Returned the correct number of total rows.');
}
/**
@@ -1990,8 +1990,8 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$records = array();
foreach ($result as $record) {
$num_records++;
- $this->assertTrue($record->$count_field >= 2, t('Record has the minimum count.'));
- $this->assertTrue($record->$count_field >= $last_count, t('Results returned in correct order.'));
+ $this->assertTrue($record->$count_field >= 2, 'Record has the minimum count.');
+ $this->assertTrue($record->$count_field >= $last_count, 'Results returned in correct order.');
$last_count = $record->$count_field;
$records[$record->$task_field] = $record->$count_field;
}
@@ -2001,10 +2001,10 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
);
foreach ($correct_results as $task => $count) {
- $this->assertEqual($records[$task], $count, t("Correct number of '@task' records found.", array('@task' => $task)));
+ $this->assertEqual($records[$task], $count, format_string("Correct number of '@task' records found.", array('@task' => $task)));
}
- $this->assertEqual($num_records, 1, t('Returned the correct number of total rows.'));
+ $this->assertEqual($num_records, 1, 'Returned the correct number of total rows.');
}
/**
@@ -2022,7 +2022,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$num_records++;
}
- $this->assertEqual($num_records, 2, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 2, 'Returned the correct number of rows.');
}
/**
@@ -2039,7 +2039,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$num_records++;
}
- $this->assertEqual($num_records, 6, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 6, 'Returned the correct number of rows.');
}
/**
@@ -2053,13 +2053,13 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$count = $query->countQuery()->execute()->fetchField();
- $this->assertEqual($count, 4, t('Counted the correct number of records.'));
+ $this->assertEqual($count, 4, 'Counted the correct number of records.');
// Now make sure we didn't break the original query! We should still have
// all of the fields we asked for.
$record = $query->execute()->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Correct data retrieved.'));
- $this->assertEqual($record->$age_field, 27, t('Correct data retrieved.'));
+ $this->assertEqual($record->$name_field, 'George', 'Correct data retrieved.');
+ $this->assertEqual($record->$age_field, 27, 'Correct data retrieved.');
}
function testHavingCountQuery() {
@@ -2070,7 +2070,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$query->addField('test', 'age');
$query->addExpression('age + 1');
$count = count($query->execute()->fetchCol());
- $this->assertEqual($count, 4, t('Counted the correct number of records.'));
+ $this->assertEqual($count, 4, 'Counted the correct number of records.');
}
/**
@@ -2085,20 +2085,20 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
// Check that the 'all_fields' statement is handled properly.
$tables = $query->getTables();
- $this->assertEqual($tables['test']['all_fields'], 1, t('Query correctly sets \'all_fields\' statement.'));
+ $this->assertEqual($tables['test']['all_fields'], 1, 'Query correctly sets \'all_fields\' statement.');
$tables = $count->getTables();
- $this->assertFalse(isset($tables['test']['all_fields']), t('Count query correctly unsets \'all_fields\' statement.'));
+ $this->assertFalse(isset($tables['test']['all_fields']), 'Count query correctly unsets \'all_fields\' statement.');
// Check that the ordering clause is handled properly.
$orderby = $query->getOrderBy();
- $this->assertEqual($orderby['name'], 'ASC', t('Query correctly sets ordering clause.'));
+ $this->assertEqual($orderby['name'], 'ASC', 'Query correctly sets ordering clause.');
$orderby = $count->getOrderBy();
- $this->assertFalse(isset($orderby['name']), t('Count query correctly unsets ordering caluse.'));
+ $this->assertFalse(isset($orderby['name']), 'Count query correctly unsets ordering caluse.');
// Make sure that the count query works.
$count = $count->execute()->fetchField();
- $this->assertEqual($count, 4, t('Counted the correct number of records.'));
+ $this->assertEqual($count, 4, 'Counted the correct number of records.');
}
@@ -2113,11 +2113,11 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
// records in the {test} table).
$query = db_select('test');
$query->fields('test', array('fail'));
- $this->assertEqual(4, $query->countQuery()->execute()->fetchField(), t('Count Query removed fields'));
+ $this->assertEqual(4, $query->countQuery()->execute()->fetchField(), 'Count Query removed fields');
$query = db_select('test');
$query->addExpression('fail');
- $this->assertEqual(4, $query->countQuery()->execute()->fetchField(), t('Count Query removed expressions'));
+ $this->assertEqual(4, $query->countQuery()->execute()->fetchField(), 'Count Query removed expressions');
}
/**
@@ -2130,7 +2130,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$count = $query->countQuery()->execute()->fetchField();
- $this->assertEqual($count, 6, t('Counted the correct number of records.'));
+ $this->assertEqual($count, 6, 'Counted the correct number of records.');
}
/**
@@ -2143,7 +2143,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$count = $query->countQuery()->execute()->fetchField();
- $this->assertEqual($count, 3, t('Counted the correct number of records.'));
+ $this->assertEqual($count, 3, 'Counted the correct number of records.');
// Use a column alias as, without one, the query can succeed for the wrong
// reason.
@@ -2155,7 +2155,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$count = $query->countQuery()->execute()->fetchField();
- $this->assertEqual($count, 3, t('Counted the correct number of records.'));
+ $this->assertEqual($count, 3, 'Counted the correct number of records.');
}
/**
@@ -2172,7 +2172,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$query->condition(db_or()->condition('age', 26)->condition('age', 27));
$job = $query->execute()->fetchField();
- $this->assertEqual($job, 'Songwriter', t('Correct data retrieved.'));
+ $this->assertEqual($job, 'Songwriter', 'Correct data retrieved.');
}
/**
@@ -2185,8 +2185,8 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$query->addField($alias, 'job', 'otherjob');
$query->where("$alias.name <> test.name");
$crowded_job = $query->execute()->fetch();
- $this->assertEqual($crowded_job->job, $crowded_job->otherjob, t('Correctly joined same table twice.'));
- $this->assertNotEqual($crowded_job->name, $crowded_job->othername, t('Correctly joined same table twice.'));
+ $this->assertEqual($crowded_job->job, $crowded_job->otherjob, 'Correctly joined same table twice.');
+ $this->assertNotEqual($crowded_job->name, $crowded_job->othername, 'Correctly joined same table twice.');
}
}
@@ -2251,7 +2251,7 @@ class DatabaseSelectComplexTestCase2 extends DatabaseTestCase {
// Verify that the string only has one copy of condition placeholder 0.
$pos = strpos($str, 'db_condition_placeholder_0', 0);
$pos2 = strpos($str, 'db_condition_placeholder_0', $pos + 1);
- $this->assertFalse($pos2, "Condition placeholder is not repeated");
+ $this->assertFalse($pos2, 'Condition placeholder is not repeated.');
}
}
@@ -2295,7 +2295,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
$correct_number = $count - ($limit * $page);
}
- $this->assertEqual(count($data->names), $correct_number, t('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
+ $this->assertEqual(count($data->names), $correct_number, format_string('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
}
}
@@ -2329,7 +2329,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
$correct_number = $count - ($limit * $page);
}
- $this->assertEqual(count($data->names), $correct_number, t('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
+ $this->assertEqual(count($data->names), $correct_number, format_string('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
}
}
@@ -2351,7 +2351,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
$ages = $outer_query
->execute()
->fetchCol();
- $this->assertEqual($ages, array(25, 26, 27, 28), t('Inner pager query returned the correct ages.'));
+ $this->assertEqual($ages, array(25, 26, 27, 28), 'Inner pager query returned the correct ages.');
}
/**
@@ -2371,7 +2371,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
$ages = $query
->execute()
->fetchCol();
- $this->assertEqual($ages, array('George', 'Ringo'), t('Pager query with having expression returned the correct ages.'));
+ $this->assertEqual($ages, array('George', 'Ringo'), 'Pager query with having expression returned the correct ages.');
}
/**
@@ -2387,7 +2387,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
->limit(1)
->execute()
->fetchField();
- $this->assertEqual($name, 'Paul', t('Pager query #1 with a specified element ID returned the correct results.'));
+ $this->assertEqual($name, 'Paul', 'Pager query #1 with a specified element ID returned the correct results.');
// Setting an element smaller than the previous one
// should not overwrite the pager $maxElement with a smaller value.
@@ -2398,7 +2398,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
->limit(1)
->execute()
->fetchField();
- $this->assertEqual($name, 'George', t('Pager query #2 with a specified element ID returned the correct results.'));
+ $this->assertEqual($name, 'George', 'Pager query #2 with a specified element ID returned the correct results.');
$name = db_select('test', 't')->extend('PagerDefault')
->fields('t', array('name'))
@@ -2406,7 +2406,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase {
->limit(1)
->execute()
->fetchField();
- $this->assertEqual($name, 'John', t('Pager query #3 with a generated element ID returned the correct results.'));
+ $this->assertEqual($name, 'John', 'Pager query #3 with a generated element ID returned the correct results.');
unset($_GET['page']);
}
@@ -2446,8 +2446,8 @@ class DatabaseSelectTableSortDefaultTestCase extends DatabaseTestCase {
$first = array_shift($data->tasks);
$last = array_pop($data->tasks);
- $this->assertEqual($first->task, $sort['first'], t('Items appear in the correct order.'));
- $this->assertEqual($last->task, $sort['last'], t('Items appear in the correct order.'));
+ $this->assertEqual($first->task, $sort['first'], 'Items appear in the correct order.');
+ $this->assertEqual($last->task, $sort['last'], 'Items appear in the correct order.');
}
}
@@ -2472,8 +2472,8 @@ class DatabaseSelectTableSortDefaultTestCase extends DatabaseTestCase {
$first = array_shift($data->tasks);
$last = array_pop($data->tasks);
- $this->assertEqual($first->task, $sort['first'], t('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
- $this->assertEqual($last->task, $sort['last'], t('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
+ $this->assertEqual($first->task, $sort['first'], format_string('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
+ $this->assertEqual($last->task, $sort['last'], format_string('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
}
}
@@ -2513,8 +2513,8 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query->addTag('test');
- $this->assertTrue($query->hasTag('test'), t('hasTag() returned true.'));
- $this->assertFalse($query->hasTag('other'), t('hasTag() returned false.'));
+ $this->assertTrue($query->hasTag('test'), 'hasTag() returned true.');
+ $this->assertFalse($query->hasTag('other'), 'hasTag() returned false.');
}
/**
@@ -2528,8 +2528,8 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query->addTag('test');
$query->addTag('other');
- $this->assertTrue($query->hasAllTags('test', 'other'), t('hasAllTags() returned true.'));
- $this->assertFalse($query->hasAllTags('test', 'stuff'), t('hasAllTags() returned false.'));
+ $this->assertTrue($query->hasAllTags('test', 'other'), 'hasAllTags() returned true.');
+ $this->assertFalse($query->hasAllTags('test', 'stuff'), 'hasAllTags() returned false.');
}
/**
@@ -2542,8 +2542,8 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query->addTag('test');
- $this->assertTrue($query->hasAnyTag('test', 'other'), t('hasAnyTag() returned true.'));
- $this->assertFalse($query->hasAnyTag('other', 'stuff'), t('hasAnyTag() returned false.'));
+ $this->assertTrue($query->hasAnyTag('test', 'other'), 'hasAnyTag() returned true.');
+ $this->assertFalse($query->hasAnyTag('other', 'stuff'), 'hasAnyTag() returned false.');
}
/**
@@ -2564,10 +2564,10 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query->addMetaData('test', $data);
$return = $query->getMetaData('test');
- $this->assertEqual($data, $return, t('Corect metadata returned.'));
+ $this->assertEqual($data, $return, 'Corect metadata returned.');
$return = $query->getMetaData('nothere');
- $this->assertNull($return, t('Non-existent key returned NULL.'));
+ $this->assertNull($return, 'Non-existent key returned NULL.');
}
}
@@ -2602,7 +2602,7 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$num_records++;
}
- $this->assertEqual($num_records, 2, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 2, 'Returned the correct number of rows.');
}
/**
@@ -2619,14 +2619,14 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$records = $result->fetchAll();
- $this->assertEqual(count($records), 2, t('Returned the correct number of rows.'));
+ $this->assertEqual(count($records), 2, 'Returned the correct number of rows.');
- $this->assertEqual($records[0]->name, 'George', t('Correct data retrieved.'));
- $this->assertEqual($records[0]->$tid_field, 4, t('Correct data retrieved.'));
- $this->assertEqual($records[0]->$task_field, 'sing', t('Correct data retrieved.'));
- $this->assertEqual($records[1]->name, 'George', t('Correct data retrieved.'));
- $this->assertEqual($records[1]->$tid_field, 5, t('Correct data retrieved.'));
- $this->assertEqual($records[1]->$task_field, 'sleep', t('Correct data retrieved.'));
+ $this->assertEqual($records[0]->name, 'George', 'Correct data retrieved.');
+ $this->assertEqual($records[0]->$tid_field, 4, 'Correct data retrieved.');
+ $this->assertEqual($records[0]->$task_field, 'sing', 'Correct data retrieved.');
+ $this->assertEqual($records[1]->name, 'George', 'Correct data retrieved.');
+ $this->assertEqual($records[1]->$tid_field, 5, 'Correct data retrieved.');
+ $this->assertEqual($records[1]->$task_field, 'sleep', 'Correct data retrieved.');
}
/**
@@ -2647,11 +2647,11 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$records = $result->fetchAll();
- $this->assertEqual(count($records), 1, t('Returned the correct number of rows.'));
- $this->assertEqual($records[0]->$name_field, 'John', t('Correct data retrieved.'));
- $this->assertEqual($records[0]->$tid_field, 2, t('Correct data retrieved.'));
- $this->assertEqual($records[0]->$pid_field, 1, t('Correct data retrieved.'));
- $this->assertEqual($records[0]->$task_field, 'sleep', t('Correct data retrieved.'));
+ $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
+ $this->assertEqual($records[0]->$name_field, 'John', 'Correct data retrieved.');
+ $this->assertEqual($records[0]->$tid_field, 2, 'Correct data retrieved.');
+ $this->assertEqual($records[0]->$pid_field, 1, 'Correct data retrieved.');
+ $this->assertEqual($records[0]->$task_field, 'sleep', 'Correct data retrieved.');
}
/**
@@ -2665,8 +2665,8 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$query->addTag('database_test_alter_change_fields');
$record = $query->execute()->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Correct data retrieved.'));
- $this->assertFalse(isset($record->$age_field), t('Age field not found, as intended.'));
+ $this->assertEqual($record->$name_field, 'George', 'Correct data retrieved.');
+ $this->assertFalse(isset($record->$age_field), 'Age field not found, as intended.');
}
/**
@@ -2683,8 +2683,8 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
// Ensure that we got the right record.
$record = $result->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
- $this->assertEqual($record->$age_field, 27*3, t('Fetched age expression is correct.'));
+ $this->assertEqual($record->$name_field, 'George', 'Fetched name is correct.');
+ $this->assertEqual($record->$age_field, 27*3, 'Fetched age expression is correct.');
}
/**
@@ -2699,7 +2699,7 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$num_records = count($query->execute()->fetchAll());
- $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
+ $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
}
/**
@@ -2723,8 +2723,8 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$name_field = $query->addField('pq', 'name');
$record = $query->execute()->fetch();
- $this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
- $this->assertEqual($record->$age_field, 27*3, t('Fetched age expression is correct.'));
+ $this->assertEqual($record->$name_field, 'George', 'Fetched name is correct.');
+ $this->assertEqual($record->$age_field, 27*3, 'Fetched age expression is correct.');
}
}
@@ -2758,31 +2758,31 @@ class DatabaseRegressionTestCase extends DatabaseTestCase {
))->execute();
$from_database = db_query('SELECT name FROM {test} WHERE name = :name', array(':name' => $name))->fetchField();
- $this->assertIdentical($name, $from_database, t("The database handles UTF-8 characters cleanly."));
+ $this->assertIdentical($name, $from_database, "The database handles UTF-8 characters cleanly.");
}
/**
* Test the db_table_exists() function.
*/
function testDBTableExists() {
- $this->assertIdentical(TRUE, db_table_exists('node'), t('Returns true for existent table.'));
- $this->assertIdentical(FALSE, db_table_exists('nosuchtable'), t('Returns false for nonexistent table.'));
+ $this->assertIdentical(TRUE, db_table_exists('node'), 'Returns true for existent table.');
+ $this->assertIdentical(FALSE, db_table_exists('nosuchtable'), 'Returns false for nonexistent table.');
}
/**
* Test the db_field_exists() function.
*/
function testDBFieldExists() {
- $this->assertIdentical(TRUE, db_field_exists('node', 'nid'), t('Returns true for existent column.'));
- $this->assertIdentical(FALSE, db_field_exists('node', 'nosuchcolumn'), t('Returns false for nonexistent column.'));
+ $this->assertIdentical(TRUE, db_field_exists('node', 'nid'), 'Returns true for existent column.');
+ $this->assertIdentical(FALSE, db_field_exists('node', 'nosuchcolumn'), 'Returns false for nonexistent column.');
}
/**
* Test the db_index_exists() function.
*/
function testDBIndexExists() {
- $this->assertIdentical(TRUE, db_index_exists('node', 'node_created'), t('Returns true for existent index.'));
- $this->assertIdentical(FALSE, db_index_exists('node', 'nosuchindex'), t('Returns false for nonexistent index.'));
+ $this->assertIdentical(TRUE, db_index_exists('node', 'node_created'), 'Returns true for existent index.');
+ $this->assertIdentical(FALSE, db_index_exists('node', 'nosuchindex'), 'Returns false for nonexistent index.');
}
}
@@ -2813,10 +2813,10 @@ class DatabaseLoggingTestCase extends DatabaseTestCase {
$queries = Database::getLog('testing', 'default');
- $this->assertEqual(count($queries), 3, t('Correct number of queries recorded.'));
+ $this->assertEqual(count($queries), 3, 'Correct number of queries recorded.');
foreach ($queries as $query) {
- $this->assertEqual($query['caller']['function'], __FUNCTION__, t('Correct function in query log.'));
+ $this->assertEqual($query['caller']['function'], __FUNCTION__, 'Correct function in query log.');
}
}
@@ -2835,8 +2835,8 @@ class DatabaseLoggingTestCase extends DatabaseTestCase {
$queries1 = Database::getLog('testing1');
$queries2 = Database::getLog('testing2');
- $this->assertEqual(count($queries1), 2, t('Correct number of queries recorded for log 1.'));
- $this->assertEqual(count($queries2), 1, t('Correct number of queries recorded for log 2.'));
+ $this->assertEqual(count($queries1), 2, 'Correct number of queries recorded for log 1.');
+ $this->assertEqual(count($queries2), 1, 'Correct number of queries recorded for log 2.');
}
/**
@@ -2856,9 +2856,9 @@ class DatabaseLoggingTestCase extends DatabaseTestCase {
$queries1 = Database::getLog('testing1');
- $this->assertEqual(count($queries1), 2, t('Recorded queries from all targets.'));
- $this->assertEqual($queries1[0]['target'], 'default', t('First query used default target.'));
- $this->assertEqual($queries1[1]['target'], 'slave', t('Second query used slave target.'));
+ $this->assertEqual(count($queries1), 2, 'Recorded queries from all targets.');
+ $this->assertEqual($queries1[0]['target'], 'default', 'First query used default target.');
+ $this->assertEqual($queries1[1]['target'], 'slave', 'Second query used slave target.');
}
/**
@@ -2882,9 +2882,9 @@ class DatabaseLoggingTestCase extends DatabaseTestCase {
$queries1 = Database::getLog('testing1');
- $this->assertEqual(count($queries1), 2, t('Recorded queries from all targets.'));
- $this->assertEqual($queries1[0]['target'], 'default', t('First query used default target.'));
- $this->assertEqual($queries1[1]['target'], 'default', t('Second query used default target as fallback.'));
+ $this->assertEqual(count($queries1), 2, 'Recorded queries from all targets.');
+ $this->assertEqual($queries1[0]['target'], 'default', 'First query used default target.');
+ $this->assertEqual($queries1[1]['target'], 'default', 'Second query used default target as fallback.');
}
/**
@@ -2910,8 +2910,8 @@ class DatabaseLoggingTestCase extends DatabaseTestCase {
$queries1 = Database::getLog('testing1');
$queries2 = Database::getLog('testing1', 'test2');
- $this->assertEqual(count($queries1), 1, t('Correct number of queries recorded for first connection.'));
- $this->assertEqual(count($queries2), 1, t('Correct number of queries recorded for second connection.'));
+ $this->assertEqual(count($queries1), 1, 'Correct number of queries recorded for first connection.');
+ $this->assertEqual(count($queries2), 1, 'Correct number of queries recorded for second connection.');
}
}
@@ -2938,7 +2938,7 @@ class DatabaseSerializeQueryTestCase extends DatabaseTestCase {
// assertion.
$query = unserialize(serialize($query));
$results = $query->execute()->fetchCol();
- $this->assertEqual($results[0], 28, t('Query properly executed after unserialization.'));
+ $this->assertEqual($results[0], 28, 'Query properly executed after unserialization.');
}
}
@@ -2964,12 +2964,12 @@ class DatabaseRangeQueryTestCase extends DrupalWebTestCase {
function testRangeQuery() {
// Test if return correct number of rows.
$range_rows = db_query_range("SELECT name FROM {system} ORDER BY name", 2, 3)->fetchAll();
- $this->assertEqual(count($range_rows), 3, t('Range query work and return correct number of rows.'));
+ $this->assertEqual(count($range_rows), 3, 'Range query work and return correct number of rows.');
// Test if return target data.
$raw_rows = db_query('SELECT name FROM {system} ORDER BY name')->fetchAll();
$raw_rows = array_slice($raw_rows, 2, 3);
- $this->assertEqual($range_rows, $raw_rows, t('Range query work and return target data.'));
+ $this->assertEqual($range_rows, $raw_rows, 'Range query work and return target data.');
}
}
@@ -3003,19 +3003,19 @@ class DatabaseTemporaryQueryTestCase extends DrupalWebTestCase {
$this->drupalGet('database_test/db_query_temporary');
$data = json_decode($this->drupalGetContent());
if ($data) {
- $this->assertEqual($this->countTableRows("system"), $data->row_count, t('The temporary table contains the correct amount of rows.'));
- $this->assertFalse(db_table_exists($data->table_name), t('The temporary table is, indeed, temporary.'));
+ $this->assertEqual($this->countTableRows("system"), $data->row_count, 'The temporary table contains the correct amount of rows.');
+ $this->assertFalse(db_table_exists($data->table_name), 'The temporary table is, indeed, temporary.');
}
else {
- $this->fail(t("The creation of the temporary table failed."));
+ $this->fail("The creation of the temporary table failed.");
}
// Now try to run two db_query_temporary() in the same request.
$table_name_system = db_query_temporary('SELECT status FROM {system}', array());
$table_name_users = db_query_temporary('SELECT uid FROM {users}', array());
- $this->assertEqual($this->countTableRows($table_name_system), $this->countTableRows("system"), t('A temporary table was created successfully in this request.'));
- $this->assertEqual($this->countTableRows($table_name_users), $this->countTableRows("users"), t('A second temporary table was created successfully in this request.'));
+ $this->assertEqual($this->countTableRows($table_name_system), $this->countTableRows("system"), 'A temporary table was created successfully in this request.');
+ $this->assertEqual($this->countTableRows($table_name_users), $this->countTableRows("users"), 'A second temporary table was created successfully in this request.');
}
}
@@ -3050,7 +3050,7 @@ class DatabaseBasicSyntaxTestCase extends DatabaseTestCase {
':a4' => ' a ',
':a5' => 'test.',
));
- $this->assertIdentical($result->fetchField(), 'This is a test.', t('Basic CONCAT works.'));
+ $this->assertIdentical($result->fetchField(), 'This is a test.', 'Basic CONCAT works.');
}
/**
@@ -3063,7 +3063,7 @@ class DatabaseBasicSyntaxTestCase extends DatabaseTestCase {
':a3' => '.',
':age' => 25,
));
- $this->assertIdentical($result->fetchField(), 'The age of John is 25.', t('Field CONCAT works.'));
+ $this->assertIdentical($result->fetchField(), 'The age of John is 25.', 'Field CONCAT works.');
}
/**
@@ -3082,14 +3082,14 @@ class DatabaseBasicSyntaxTestCase extends DatabaseTestCase {
->countQuery()
->execute()
->fetchField();
- $this->assertIdentical($num_matches, '2', t('Found 2 records.'));
+ $this->assertIdentical($num_matches, '2', 'Found 2 records.');
// Match only "Ring_" using a LIKE expression with no wildcards.
$num_matches = db_select('test', 't')
->condition('name', db_like('Ring_'), 'LIKE')
->countQuery()
->execute()
->fetchField();
- $this->assertIdentical($num_matches, '1', t('Found 1 record.'));
+ $this->assertIdentical($num_matches, '1', 'Found 1 record.');
}
/**
@@ -3113,14 +3113,14 @@ class DatabaseBasicSyntaxTestCase extends DatabaseTestCase {
->countQuery()
->execute()
->fetchField();
- $this->assertIdentical($num_matches, '2', t('Found 2 records.'));
+ $this->assertIdentical($num_matches, '2', 'Found 2 records.');
// Match only the former using a LIKE expression with no wildcards.
$num_matches = db_select('test', 't')
->condition('name', db_like('abc%\_'), 'LIKE')
->countQuery()
->execute()
->fetchField();
- $this->assertIdentical($num_matches, '1', t('Found 1 record.'));
+ $this->assertIdentical($num_matches, '1', 'Found 1 record.');
}
}
@@ -3151,9 +3151,9 @@ class DatabaseCaseSensitivityTestCase extends DatabaseTestCase {
->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical($num_records_before + 1, (int) $num_records_after, t('Record inserts correctly.'));
+ $this->assertIdentical($num_records_before + 1, (int) $num_records_after, 'Record inserts correctly.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'john'))->fetchField();
- $this->assertIdentical($saved_age, '2', t('Can retrieve after inserting.'));
+ $this->assertIdentical($saved_age, '2', 'Can retrieve after inserting.');
}
}
@@ -3196,7 +3196,7 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase {
'job' => 'Singer',
))
->execute();
- $this->fail(t('Insert succeedded when it should not have.'));
+ $this->fail('Insert succeedded when it should not have.');
}
catch (Exception $e) {
// Check if the first record was inserted.
@@ -3208,14 +3208,14 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase {
// Database engines that don't support transactions can leave partial
// inserts in place when an error occurs. This is the case for MySQL
// when running on a MyISAM table.
- $this->pass(t("The whole transaction has not been rolled-back when a duplicate key insert occurs, this is expected because the database doesn't support transactions"));
+ $this->pass("The whole transaction has not been rolled-back when a duplicate key insert occurs, this is expected because the database doesn't support transactions");
}
else {
- $this->fail(t('The whole transaction is rolled back when a duplicate key insert occurs.'));
+ $this->fail('The whole transaction is rolled back when a duplicate key insert occurs.');
}
}
else {
- $this->pass(t('The whole transaction is rolled back when a duplicate key insert occurs.'));
+ $this->pass('The whole transaction is rolled back when a duplicate key insert occurs.');
}
// Ensure the other values were not inserted.
@@ -3224,7 +3224,7 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase {
->condition('age', array(17, 75), 'IN')
->execute()->fetchObject();
- $this->assertFalse($record, t('The rest of the insert aborted as expected.'));
+ $this->assertFalse($record, 'The rest of the insert aborted as expected.');
}
}
@@ -3252,7 +3252,7 @@ class DatabaseQueryTestCase extends DatabaseTestCase {
function testArraySubstitution() {
$names = db_query('SELECT name FROM {test} WHERE age IN (:ages) ORDER BY age', array(':ages' => array(25, 26, 27)))->fetchAll();
- $this->assertEqual(count($names), 3, t('Correct number of names returned'));
+ $this->assertEqual(count($names), 3, 'Correct number of names returned');
}
}
@@ -3320,19 +3320,19 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
))
->execute();
- $this->assertTrue($connection->inTransaction(), t('In transaction before calling nested transaction.'));
+ $this->assertTrue($connection->inTransaction(), 'In transaction before calling nested transaction.');
// We're already in a transaction, but we call ->transactionInnerLayer
// to nest another transaction inside the current one.
$this->transactionInnerLayer($suffix, $rollback, $ddl_statement);
- $this->assertTrue($connection->inTransaction(), t('In transaction after calling nested transaction.'));
+ $this->assertTrue($connection->inTransaction(), 'In transaction after calling nested transaction.');
if ($rollback) {
// Roll back the transaction, if requested.
// This rollback should propagate to the last savepoint.
$txn->rollback();
- $this->assertTrue(($connection->transactionDepth() == $depth), t('Transaction has rolled back to the last savepoint after calling rollback().'));
+ $this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollback().');
}
}
@@ -3358,7 +3358,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
$txn = db_transaction();
$depth2 = $connection->transactionDepth();
- $this->assertTrue($depth < $depth2, t('Transaction depth is has increased with new transaction.'));
+ $this->assertTrue($depth < $depth2, 'Transaction depth is has increased with new transaction.');
// Insert a single row into the testing table.
db_insert('test')
@@ -3368,7 +3368,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
))
->execute();
- $this->assertTrue($connection->inTransaction(), t('In transaction inside nested transaction.'));
+ $this->assertTrue($connection->inTransaction(), 'In transaction inside nested transaction.');
if ($ddl_statement) {
$table = array(
@@ -3383,14 +3383,14 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
);
db_create_table('database_test_1', $table);
- $this->assertTrue($connection->inTransaction(), t('In transaction inside nested transaction.'));
+ $this->assertTrue($connection->inTransaction(), 'In transaction inside nested transaction.');
}
if ($rollback) {
// Roll back the transaction, if requested.
// This rollback should propagate to the last savepoint.
$txn->rollback();
- $this->assertTrue(($connection->transactionDepth() == $depth), t('Transaction has rolled back to the last savepoint after calling rollback().'));
+ $this->assertTrue(($connection->transactionDepth() == $depth), 'Transaction has rolled back to the last savepoint after calling rollback().');
}
}
@@ -3411,9 +3411,9 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
// Neither of the rows we inserted in the two transaction layers
// should be present in the tables post-rollback.
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DavidB'))->fetchField();
- $this->assertNotIdentical($saved_age, '24', t('Cannot retrieve DavidB row after commit.'));
+ $this->assertNotIdentical($saved_age, '24', 'Cannot retrieve DavidB row after commit.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DanielB'))->fetchField();
- $this->assertNotIdentical($saved_age, '19', t('Cannot retrieve DanielB row after commit.'));
+ $this->assertNotIdentical($saved_age, '19', 'Cannot retrieve DanielB row after commit.');
}
catch (Exception $e) {
$this->fail($e->getMessage());
@@ -3437,9 +3437,9 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
// Because our current database claims to not support transactions,
// the inserted rows should be present despite the attempt to roll back.
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DavidB'))->fetchField();
- $this->assertIdentical($saved_age, '24', t('DavidB not rolled back, since transactions are not supported.'));
+ $this->assertIdentical($saved_age, '24', 'DavidB not rolled back, since transactions are not supported.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DanielB'))->fetchField();
- $this->assertIdentical($saved_age, '19', t('DanielB not rolled back, since transactions are not supported.'));
+ $this->assertIdentical($saved_age, '19', 'DanielB not rolled back, since transactions are not supported.');
}
catch (Exception $e) {
$this->fail($e->getMessage());
@@ -3459,9 +3459,9 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
// Because we committed, both of the inserted rows should be present.
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DavidA'))->fetchField();
- $this->assertIdentical($saved_age, '24', t('Can retrieve DavidA row after commit.'));
+ $this->assertIdentical($saved_age, '24', 'Can retrieve DavidA row after commit.');
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DanielA'))->fetchField();
- $this->assertIdentical($saved_age, '19', t('Can retrieve DanielA row after commit.'));
+ $this->assertIdentical($saved_age, '19', 'Can retrieve DanielA row after commit.');
}
catch (Exception $e) {
$this->fail($e->getMessage());
@@ -3553,7 +3553,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
// $this->fail(t('Rolling back a transaction containing DDL should fail.'));
}
catch (DatabaseTransactionNoActiveException $e) {
- $this->pass(t('Rolling back a transaction containing DDL should fail.'));
+ $this->pass('Rolling back a transaction containing DDL should fail.');
}
$this->assertRowPresent('row');
}
@@ -3606,7 +3606,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
*/
function assertRowPresent($name, $message = NULL) {
if (!isset($message)) {
- $message = t('Row %name is present.', array('%name' => $name));
+ $message = format_string('Row %name is present.', array('%name' => $name));
}
$present = (boolean) db_query('SELECT 1 FROM {test} WHERE name = :name', array(':name' => $name))->fetchField();
return $this->assertTrue($present, $message);
@@ -3622,7 +3622,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
*/
function assertRowAbsent($name, $message = NULL) {
if (!isset($message)) {
- $message = t('Row %name is absent.', array('%name' => $name));
+ $message = format_string('Row %name is absent.', array('%name' => $name));
}
$present = (boolean) db_query('SELECT 1 FROM {test} WHERE name = :name', array(':name' => $name))->fetchField();
return $this->assertFalse($present, $message);
@@ -3646,10 +3646,10 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
$this->insertRow('inner');
// Pop the inner transaction.
unset($transaction2);
- $this->assertTrue($database->inTransaction(), t('Still in a transaction after popping the inner transaction'));
+ $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the inner transaction');
// Pop the outer transaction.
unset($transaction);
- $this->assertFalse($database->inTransaction(), t('Transaction closed after popping the outer transaction'));
+ $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the outer transaction');
$this->assertRowPresent('outer');
$this->assertRowPresent('inner');
@@ -3662,10 +3662,10 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
// Pop the outer transaction, nothing should happen.
unset($transaction);
$this->insertRow('inner-after-outer-commit');
- $this->assertTrue($database->inTransaction(), t('Still in a transaction after popping the outer transaction'));
+ $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction');
// Pop the inner transaction, the whole transaction should commit.
unset($transaction2);
- $this->assertFalse($database->inTransaction(), t('Transaction closed after popping the inner transaction'));
+ $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction');
$this->assertRowPresent('outer');
$this->assertRowPresent('inner');
$this->assertRowPresent('inner-after-outer-commit');
@@ -3679,11 +3679,11 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
// Now rollback the inner transaction.
$transaction2->rollback();
unset($transaction2);
- $this->assertTrue($database->inTransaction(), t('Still in a transaction after popping the outer transaction'));
+ $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction');
// Pop the outer transaction, it should commit.
$this->insertRow('outer-after-inner-rollback');
unset($transaction);
- $this->assertFalse($database->inTransaction(), t('Transaction closed after popping the inner transaction'));
+ $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction');
$this->assertRowPresent('outer');
$this->assertRowAbsent('inner');
$this->assertRowPresent('outer-after-inner-rollback');
@@ -3696,11 +3696,11 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
$this->insertRow('inner');
// Pop the outer transaction, nothing should happen.
unset($transaction);
- $this->assertTrue($database->inTransaction(), t('Still in a transaction after popping the outer transaction'));
+ $this->assertTrue($database->inTransaction(), 'Still in a transaction after popping the outer transaction');
// Now rollback the inner transaction, it should rollback.
$transaction2->rollback();
unset($transaction2);
- $this->assertFalse($database->inTransaction(), t('Transaction closed after popping the inner transaction'));
+ $this->assertFalse($database->inTransaction(), 'Transaction closed after popping the inner transaction');
$this->assertRowPresent('outer');
$this->assertRowAbsent('inner');
@@ -3718,23 +3718,23 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
try {
$transaction->rollback();
unset($transaction);
- $this->fail(t('Rolling back the outer transaction while the inner transaction is active resulted in an exception.'));
+ $this->fail('Rolling back the outer transaction while the inner transaction is active resulted in an exception.');
}
catch (DatabaseTransactionOutOfOrderException $e) {
- $this->pass(t('Rolling back the outer transaction while the inner transaction is active resulted in an exception.'));
+ $this->pass('Rolling back the outer transaction while the inner transaction is active resulted in an exception.');
}
- $this->assertFalse($database->inTransaction(), t('No more in a transaction after rolling back the outer transaction'));
+ $this->assertFalse($database->inTransaction(), 'No more in a transaction after rolling back the outer transaction');
// Try to commit one inner transaction.
unset($transaction3);
- $this->pass(t('Trying to commit an inner transaction resulted in an exception.'));
+ $this->pass('Trying to commit an inner transaction resulted in an exception.');
// Try to rollback one inner transaction.
try {
$transaction->rollback();
unset($transaction2);
- $this->fail(t('Trying to commit an inner transaction resulted in an exception.'));
+ $this->fail('Trying to commit an inner transaction resulted in an exception.');
}
catch (DatabaseTransactionNoActiveException $e) {
- $this->pass(t('Trying to commit an inner transaction resulted in an exception.'));
+ $this->pass('Trying to commit an inner transaction resulted in an exception.');
}
$this->assertRowAbsent('outer');
$this->assertRowAbsent('inner');
@@ -3764,9 +3764,9 @@ class DatabaseNextIdCase extends DrupalWebTestCase {
// We can test for exact increase in here because we know there is no
// other process operating on these tables -- normally we could only
// expect $second > $first.
- $this->assertEqual($first + 1, $second, t('The second call from a sequence provides a number increased by one.'));
+ $this->assertEqual($first + 1, $second, 'The second call from a sequence provides a number increased by one.');
$result = db_next_id(1000);
- $this->assertEqual($result, 1001, t('Sequence provides a larger number than the existing ID.'));
+ $this->assertEqual($result, 1001, 'Sequence provides a larger number than the existing ID.');
}
}
@@ -3788,8 +3788,8 @@ class DatabaseEmptyStatementTestCase extends DrupalWebTestCase {
function testEmpty() {
$result = new DatabaseStatementEmpty();
- $this->assertTrue($result instanceof DatabaseStatementInterface, t('Class implements expected interface'));
- $this->assertNull($result->fetchObject(), t('Null result returned.'));
+ $this->assertTrue($result instanceof DatabaseStatementInterface, 'Class implements expected interface');
+ $this->assertNull($result->fetchObject(), 'Null result returned.');
}
/**
@@ -3799,11 +3799,11 @@ class DatabaseEmptyStatementTestCase extends DrupalWebTestCase {
$result = new DatabaseStatementEmpty();
foreach ($result as $record) {
- $this->fail(t('Iterating empty result set should not iterate.'));
+ $this->fail('Iterating empty result set should not iterate.');
return;
}
- $this->pass(t('Iterating empty result set skipped iteration.'));
+ $this->pass('Iterating empty result set skipped iteration.');
}
/**
@@ -3812,7 +3812,7 @@ class DatabaseEmptyStatementTestCase extends DrupalWebTestCase {
function testEmptyFetchAll() {
$result = new DatabaseStatementEmpty();
- $this->assertEqual($result->fetchAll(), array(), t('Empty array returned from empty result set.'));
+ $this->assertEqual($result->fetchAll(), array(), 'Empty array returned from empty result set.');
}
}