Remove calls to deprecated function assertAttributeX

This commit is contained in:
Jérémy Derussé 2019-08-04 11:16:42 +02:00
parent 8f87a85c07
commit d098c11539
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
2 changed files with 12 additions and 12 deletions

View File

@ -61,14 +61,14 @@ class GenericEventTest extends TestCase
public function testSetArguments()
{
$result = $this->event->setArguments(['foo' => 'bar']);
$this->assertAttributeSame(['foo' => 'bar'], 'arguments', $this->event);
$this->assertSame(['foo' => 'bar'], $this->event->getArguments());
$this->assertSame($this->event, $result);
}
public function testSetArgument()
{
$result = $this->event->setArgument('foo2', 'bar2');
$this->assertAttributeSame(['name' => 'Event', 'foo2' => 'bar2'], 'arguments', $this->event);
$this->assertSame(['name' => 'Event', 'foo2' => 'bar2'], $this->event->getArguments());
$this->assertEquals($this->event, $result);
}
@ -97,13 +97,13 @@ class GenericEventTest extends TestCase
public function testOffsetSet()
{
$this->event['foo2'] = 'bar2';
$this->assertAttributeSame(['name' => 'Event', 'foo2' => 'bar2'], 'arguments', $this->event);
$this->assertSame(['name' => 'Event', 'foo2' => 'bar2'], $this->event->getArguments());
}
public function testOffsetUnset()
{
unset($this->event['name']);
$this->assertAttributeSame([], 'arguments', $this->event);
$this->assertSame([], $this->event->getArguments());
}
public function testOffsetIsset()

View File

@ -324,15 +324,15 @@ class PdoSessionHandlerTest extends TestCase
public function testUrlDsn($url, $expectedDsn, $expectedUser = null, $expectedPassword = null)
{
$storage = new PdoSessionHandler($url);
$reflection = new \ReflectionClass(PdoSessionHandler::class);
$this->assertAttributeEquals($expectedDsn, 'dsn', $storage);
if (null !== $expectedUser) {
$this->assertAttributeEquals($expectedUser, 'username', $storage);
}
if (null !== $expectedPassword) {
$this->assertAttributeEquals($expectedPassword, 'password', $storage);
foreach (['dsn' => $expectedDsn, 'username' => $expectedUser, 'password' => $expectedPassword] as $property => $expectedValue) {
if (!isset($expectedValue)) {
continue;
}
$property = $reflection->getProperty($property);
$property->setAccessible(true);
$this->assertSame($expectedValue, $property->getValue($storage));
}
}