Skip to content

Commit 347560a

Browse files
peterrehmnicolas-grekas
authored andcommitted
Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
1 parent ed12983 commit 347560a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Tests/Adapter/ExtLdap/AdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testLdapQueryIterator()
7373
public function testLdapQueryWithoutBind()
7474
{
7575
$ldap = new Adapter($this->getLdapConfig());
76-
$this->setExpectedException(NotBoundException::class);
76+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(NotBoundException::class);
7777
$query = $ldap->createQuery('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))', array());
7878
$query->execute();
7979
}

Tests/Adapter/ExtLdap/LdapManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testLdapAddAndRemove()
5959
*/
6060
public function testLdapAddInvalidEntry()
6161
{
62-
$this->setExpectedException(LdapException::class);
62+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(LdapException::class);
6363
$this->executeSearchQuery(1);
6464

6565
// The entry is missing a subject name
@@ -105,7 +105,7 @@ public function testLdapUpdate()
105105
public function testLdapUnboundAdd()
106106
{
107107
$this->adapter = new Adapter($this->getLdapConfig());
108-
$this->setExpectedException(NotBoundException::class);
108+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(NotBoundException::class);
109109
$em = $this->adapter->getEntryManager();
110110
$em->add(new Entry(''));
111111
}
@@ -116,7 +116,7 @@ public function testLdapUnboundAdd()
116116
public function testLdapUnboundRemove()
117117
{
118118
$this->adapter = new Adapter($this->getLdapConfig());
119-
$this->setExpectedException(NotBoundException::class);
119+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(NotBoundException::class);
120120
$em = $this->adapter->getEntryManager();
121121
$em->remove(new Entry(''));
122122
}
@@ -127,7 +127,7 @@ public function testLdapUnboundRemove()
127127
public function testLdapUnboundUpdate()
128128
{
129129
$this->adapter = new Adapter($this->getLdapConfig());
130-
$this->setExpectedException(NotBoundException::class);
130+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(NotBoundException::class);
131131
$em = $this->adapter->getEntryManager();
132132
$em->update(new Entry(''));
133133
}

Tests/LdapTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testLdapCreate()
7878

7979
public function testCreateWithInvalidAdapterName()
8080
{
81-
$this->setExpectedException(DriverNotFoundException::class);
81+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(DriverNotFoundException::class);
8282
Ldap::create('foo');
8383
}
8484
}

0 commit comments

Comments
 (0)