diff -u b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php --- b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php @@ -25,10 +25,10 @@ foreach ($result as $record) { $records[] = $record; $this->assertTrue(is_object($record), 'Record is an object.'); - $this->assertIdentical($record->name, 'John', '25 year old is John.'); + $this->asserSame('25 year old is John.', $record->name, 'John'); } - $this->assertIdentical(count($records), 1, 'There is only one record.'); + $this->assertCount(1, $records, 'There is only one record.'); } /** @@ -40,10 +40,10 @@ foreach ($result as $record) { $records[] = $record; $this->assertTrue(is_object($record), 'Record is an object.'); - $this->assertIdentical($record->name, 'John', '25 year old is John.'); + $this->assertSame('John', $record->name, '25 year old is John.'); } - $this->assertIdentical(count($records), 1, 'There is only one record.'); + $this->assertCount(1, $records, 'There is only one record.'); } /** @@ -55,10 +55,10 @@ foreach ($result as $record) { $records[] = $record; $this->assertTrue(is_array($record), 'Record is an array.'); - $this->assertIdentical($record['name'], 'John', 'Record can be accessed associatively.'); + $this->assertSame('John', $record['name'], 'Record can be accessed associatively.'); } - $this->assertIdentical(count($records), 1, 'There is only one record.'); + $this->assertCount(1, $records, 'There is only one record.'); } /** @@ -72,10 +72,10 @@ foreach ($result as $record) { $records[] = $record; $this->assertTrue($record instanceof FakeRecord, 'Record is an object of class FakeRecord.'); - $this->assertIdentical($record->name, 'John', '25 year old is John.'); + $this->assertSame('John', $record->name, '25 year old is John.'); } - $this->assertIdentical(count($records), 1, 'There is only one record.'); + $this->assertCount(1, $records, 'There is only one record.'); } /** @@ -92,7 +92,7 @@ $this->assertInstanceOf(FakeRecord::class, $result); $this->assertSame('John', $result->name, '25 year old is John.'); } - $this->assertSame(1, $records, 'There is only one record.'); + $this->assertCount(1, $records, 'There is only one record.'); } /** @@ -124,10 +124,10 @@ foreach ($result as $record) { $records[] = $record; $this->assertTrue(is_array($record), 'Record is an array.'); - $this->assertIdentical($record[0], 'John', 'Record can be accessed numerically.'); + $this->assertSame('John', $record[0], 'Record can be accessed numerically.'); } - $this->assertIdentical(count($records), 1, 'There is only one record'); + $this->assertCount(1, $records, 'There is only one record'); } /** @@ -139,11 +139,11 @@ foreach ($result as $record) { $records[] = $record; $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->assertSame('John', $record[0], 'Record can be accessed numerically.'); + $this->assertSame('John', $record['name'], 'Record can be accessed associatively.'); } - $this->assertIdentical(count($records), 1, 'There is only one record.'); + $this->assertCount(1, $records, 'There is only one record.'); } /** @@ -165,12 +165,12 @@ public function testQueryFetchCol() { $result = $this->connection->query('SELECT name FROM {test} WHERE age > :age', [':age' => 25]); $column = $result->fetchCol(); - $this->assertIdentical(count($column), 3, 'fetchCol() returns the right number of records.'); + $this->assertCount(3, $column, 'fetchCol() returns the right number of records.'); $result = $this->connection->query('SELECT name FROM {test} WHERE age > :age', [':age' => 25]); $i = 0; foreach ($result as $record) { - $this->assertIdentical($record->name, $column[$i++], 'Column matches direct access.'); + $this->assertSame($column[$i++], $record->name, 'Column matches direct access.'); } }