From 4846d24e55ffd78a7c4dce33cb825b86f41b240e Mon Sep 17 00:00:00 2001 From: Damien Harper Date: Mon, 19 Aug 2019 14:26:53 +0200 Subject: [PATCH] Revert "PHP-CS-Fixer" This reverts commit b8096750 --- .../DoctrineAuditBundle/AuditManagerTest.php | 16 ++--- .../EventSubscriber/AuditSubscriberTest.php | 60 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/DoctrineAuditBundle/AuditManagerTest.php b/tests/DoctrineAuditBundle/AuditManagerTest.php index d5b84646..f5d943e6 100644 --- a/tests/DoctrineAuditBundle/AuditManagerTest.php +++ b/tests/DoctrineAuditBundle/AuditManagerTest.php @@ -54,7 +54,7 @@ public function testInsert(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'fullname' => [ 'old' => null, 'new' => 'John Doe', @@ -95,7 +95,7 @@ public function testUpdate(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'fullname' => [ 'old' => 'John Doe', 'new' => 'Dark Vador', @@ -133,7 +133,7 @@ public function testRemove(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'label' => Author::class.'#1', 'class' => Author::class, 'table' => $em->getClassMetadata(Author::class)->getTableName(), @@ -197,7 +197,7 @@ public function testAssociateOneToMany(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => Author::class.'#1', 'class' => Author::class, @@ -266,7 +266,7 @@ public function testDissociateOneToMany(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => Author::class.'#1', 'class' => Author::class, @@ -382,7 +382,7 @@ public function testAssociateManyToMany(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => (string) $post, 'class' => Post::class, @@ -404,7 +404,7 @@ public function testAssociateManyToMany(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => (string) $post, 'class' => Post::class, @@ -523,7 +523,7 @@ public function testDissociateManyToMany(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => 'First post', 'class' => Post::class, diff --git a/tests/DoctrineAuditBundle/EventSubscriber/AuditSubscriberTest.php b/tests/DoctrineAuditBundle/EventSubscriber/AuditSubscriberTest.php index 6e1756f8..281d86ae 100644 --- a/tests/DoctrineAuditBundle/EventSubscriber/AuditSubscriberTest.php +++ b/tests/DoctrineAuditBundle/EventSubscriber/AuditSubscriberTest.php @@ -52,7 +52,7 @@ public function testInsertWithoutRelation(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'fullname' => [ 'old' => null, 'new' => 'John Doe', @@ -93,7 +93,7 @@ public function testUpdateWithoutRelation(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'fullname' => [ 'old' => null, 'new' => 'John', @@ -110,7 +110,7 @@ public function testUpdateWithoutRelation(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'fullname' => [ 'old' => 'John', 'new' => 'John Doe', @@ -143,7 +143,7 @@ public function testRemoveWithoutRelation(): void $audits = $reader->getAudits(Author::class); $afterCount = \count($audits); - $this->assertSame($beforeCount + 1, $afterCount, 'removing an entity (no relation set) adds 1 entry in the audit table.'); + $this->assertEquals($beforeCount + 1, $afterCount, 'removing an entity (no relation set) adds 1 entry in the audit table.'); /** @var AuditEntry $entry */ $entry = $audits[0]; @@ -152,7 +152,7 @@ public function testRemoveWithoutRelation(): void $this->assertEquals(1, $entry->getUserId(), 'audit entry blame_id is ok.'); $this->assertSame('dark.vador', $entry->getUsername(), 'audit entry blame_user is ok.'); $this->assertSame('1.2.3.4', $entry->getIp(), 'audit entry IP is ok.'); - $this->assertSame([ + $this->assertEquals([ 'label' => Author::class.'#1', 'class' => Author::class, 'table' => $em->getClassMetadata(Author::class)->getTableName(), @@ -176,7 +176,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::INSERT, $audits[0]->getType(), 'AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => null, 'new' => 'int: null->17', @@ -194,7 +194,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'int: null->17', 'new' => 'int: 17->null', @@ -212,7 +212,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'int: 17->null', 'new' => 'int: null->24', @@ -230,7 +230,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'int: null->24', 'new' => 'int: 24->"24"', @@ -244,7 +244,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'int: 24->"24"', 'new' => 'int: "24"->24', @@ -258,7 +258,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'int: "24"->24', 'new' => 'int: 24->24.0', @@ -272,7 +272,7 @@ public function testAuditingIntValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'int: 24->24.0', 'new' => 'int: 24->null', @@ -300,7 +300,7 @@ public function testAuditingDecimalValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::INSERT, $audits[0]->getType(), 'AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => null, 'new' => 'decimal: null->10.2', @@ -318,7 +318,7 @@ public function testAuditingDecimalValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'decimal: null->10.2', 'new' => 'decimal: 10.2->"10.2"', @@ -341,7 +341,7 @@ public function testAuditingBooleanValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::INSERT, $audits[0]->getType(), 'AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => null, 'new' => 'bool: null', @@ -355,7 +355,7 @@ public function testAuditingBooleanValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'bool: null', 'new' => 'bool: null->true', @@ -373,7 +373,7 @@ public function testAuditingBooleanValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'bool: null->true', 'new' => 'bool: true->null', @@ -391,7 +391,7 @@ public function testAuditingBooleanValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'bool: true->null', 'new' => 'bool: null->false', @@ -409,7 +409,7 @@ public function testAuditingBooleanValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::UPDATE, $audits[0]->getType(), 'AuditReader::UPDATE operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => 'bool: null->false', 'new' => 'bool: false->null', @@ -437,7 +437,7 @@ public function testAuditingPhpArrayValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::INSERT, $audits[0]->getType(), 'AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => null, 'new' => 'php_array: null->[R1, R2]', @@ -465,7 +465,7 @@ public function testAuditingJsonArrayValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::INSERT, $audits[0]->getType(), 'AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => null, 'new' => 'json_array: null->[R1, R2]', @@ -493,7 +493,7 @@ public function testAuditingSimpleArrayValues(): void $audits = $reader->getAudits(DummyEntity::class); $this->assertSame(AuditReader::INSERT, $audits[0]->getType(), 'AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'label' => [ 'old' => null, 'new' => 'simple_array: null->[R1, R2]', @@ -551,7 +551,7 @@ public function testOneToManyAssociate(): void $this->assertSame(AuditReader::ASSOCIATE, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::ASSOCIATE operation.'); $this->assertSame(AuditReader::INSERT, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => Author::class.'#1', 'class' => Author::class, @@ -566,7 +566,7 @@ public function testOneToManyAssociate(): void ], ], $audits[0]->getDiffs(), 'relation ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => Author::class.'#1', 'class' => Author::class, @@ -634,7 +634,7 @@ public function testOneToManyDissociate(): void $this->assertSame(AuditReader::ASSOCIATE, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::ASSOCIATE operation.'); $this->assertSame(AuditReader::INSERT, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => Author::class.'#1', 'class' => Author::class, @@ -649,7 +649,7 @@ public function testOneToManyDissociate(): void ], ], $audits[0]->getDiffs(), 'relation ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => Author::class.'#1', 'class' => Author::class, @@ -718,7 +718,7 @@ public function testManyToManyAssociate(): void $this->assertSame(AuditReader::ASSOCIATE, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::ASSOCIATE operation.'); $this->assertSame(AuditReader::INSERT, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => (string) $post, 'class' => Post::class, @@ -734,7 +734,7 @@ public function testManyToManyAssociate(): void 'table' => 'post__tag', ], $audits[0]->getDiffs(), 'relation ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => (string) $post, 'class' => Post::class, @@ -750,7 +750,7 @@ public function testManyToManyAssociate(): void 'table' => 'post__tag', ], $audits[1]->getDiffs(), 'relation ok.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => (string) $post, 'class' => Post::class, @@ -824,7 +824,7 @@ public function testManyToManyDissociate(): void $this->assertSame(AuditReader::ASSOCIATE, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::ASSOCIATE operation.'); $this->assertSame(AuditReader::INSERT, $audits[$i++]->getType(), 'entry'.$i.' is an AuditReader::INSERT operation.'); - $this->assertSame([ + $this->assertEquals([ 'source' => [ 'label' => (string) $post, 'class' => Post::class,