Mercurial > hg > cmmr2012-drupal-site
diff core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php Thu May 09 15:34:47 2019 +0100 @@ -28,6 +28,7 @@ $admin_user = $this->drupalCreateUser(['ban IP addresses']); $this->drupalLogin($admin_user); $this->drupalGet('admin/config/people/ban'); + $connection = Database::getConnection(); // Ban a valid IP address. $edit = []; @@ -78,13 +79,12 @@ // Test duplicate ip address are not present in the 'blocked_ips' table. // when they are entered programmatically. - $connection = Database::getConnection(); $banIp = new BanIpManager($connection); $ip = '1.0.0.0'; $banIp->banIp($ip); $banIp->banIp($ip); $banIp->banIp($ip); - $query = db_select('ban_ip', 'bip'); + $query = $connection->select('ban_ip', 'bip'); $query->fields('bip', ['iid']); $query->condition('bip.ip', $ip); $ip_count = $query->execute()->fetchAll(); @@ -92,7 +92,7 @@ $ip = ''; $banIp->banIp($ip); $banIp->banIp($ip); - $query = db_select('ban_ip', 'bip'); + $query = $connection->select('ban_ip', 'bip'); $query->fields('bip', ['iid']); $query->condition('bip.ip', $ip); $ip_count = $query->execute()->fetchAll();