Skip to content

Commit

Permalink
Change assertSame to assertEquals
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Nov 24, 2023
1 parent 8c862dd commit bb3e289
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tests/ORM/Functional/Driver/Common/Select/JsonMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testWhereJson(): void
$user = $selector->whereJson('settings->theme', 'light')->fetchOne();

$this->assertSame(2, $user->id);
$this->assertSame(['theme' => 'light'], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($user->settings, true));
}

public function testWhereJsonWithRelation(): void
Expand All @@ -81,7 +81,7 @@ public function testWhereJsonWithRelation(): void
$post = $selector->whereJson('user.settings->theme', 'light')->fetchOne();

$this->assertSame(2, $post->id);
$this->assertSame(['theme' => 'light'], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($post->user->settings, true));
}

public function testOrWhereJson(): void
Expand All @@ -93,7 +93,7 @@ public function testOrWhereJson(): void
->fetchOne();

$this->assertSame(2, $user->id);
$this->assertSame(['theme' => 'light'], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($user->settings, true));
}

public function testOrWhereJsonWithRelation(): void
Expand All @@ -105,7 +105,7 @@ public function testOrWhereJsonWithRelation(): void
->fetchOne();

$this->assertSame(2, $post->id);
$this->assertSame(['theme' => 'light'], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($post->user->settings, true));
}

public function testWhereJsonContains(): void
Expand All @@ -114,7 +114,7 @@ public function testWhereJsonContains(): void
$user = $selector->whereJsonContains('settings->theme', 'light')->fetchOne();

$this->assertSame(2, $user->id);
$this->assertSame(['theme' => 'light'], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($user->settings, true));
}

public function testWhereJsonContainsWithRelation(): void
Expand All @@ -123,7 +123,7 @@ public function testWhereJsonContainsWithRelation(): void
$post = $selector->whereJsonContains('user.settings->theme', 'light')->fetchOne();

$this->assertSame(2, $post->id);
$this->assertSame(['theme' => 'light'], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($post->user->settings, true));
}

public function testOrWhereJsonContains(): void
Expand All @@ -135,7 +135,7 @@ public function testOrWhereJsonContains(): void
->fetchOne();

$this->assertSame(2, $user->id);
$this->assertSame(['theme' => 'light'], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($user->settings, true));
}

public function testOrWhereJsonContainsWithRelation(): void
Expand All @@ -147,7 +147,7 @@ public function testOrWhereJsonContainsWithRelation(): void
->fetchOne();

$this->assertSame(2, $post->id);
$this->assertSame(['theme' => 'light'], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($post->user->settings, true));
}

public function testWhereJsonDoesntContain(): void
Expand All @@ -156,7 +156,7 @@ public function testWhereJsonDoesntContain(): void
$user = $selector->whereJsonDoesntContain('settings->theme', 'light')->fetchOne();

$this->assertSame(1, $user->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
}

public function testWhereJsonDoesntContainWithRelation(): void
Expand All @@ -165,7 +165,7 @@ public function testWhereJsonDoesntContainWithRelation(): void
$post = $selector->whereJsonDoesntContain('user.settings->theme', 'light')->fetchOne();

$this->assertSame(1, $post->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
}

public function testOrWhereJsonDoesntContain(): void
Expand All @@ -177,7 +177,7 @@ public function testOrWhereJsonDoesntContain(): void
->fetchOne();

$this->assertSame(1, $user->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
}

public function testOrWhereJsonDoesntContainWithRelation(): void
Expand All @@ -189,7 +189,7 @@ public function testOrWhereJsonDoesntContainWithRelation(): void
->fetchOne();

$this->assertSame(1, $post->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
}

public function testWhereJsonContainsKey(): void
Expand All @@ -198,7 +198,7 @@ public function testWhereJsonContainsKey(): void
$user = $selector->whereJsonContainsKey('settings->foo')->fetchOne();

$this->assertSame(1, $user->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
}

public function testWhereJsonContainsKeyWithRelation(): void
Expand All @@ -207,7 +207,7 @@ public function testWhereJsonContainsKeyWithRelation(): void
$post = $selector->whereJsonContainsKey('user.settings->foo')->fetchOne();

$this->assertSame(1, $post->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
}

public function testOrWhereJsonContainsKey(): void
Expand All @@ -219,7 +219,7 @@ public function testOrWhereJsonContainsKey(): void
->fetchOne();

$this->assertSame(1, $user->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
}

public function testOrWhereJsonContainsKeyWithRelation(): void
Expand All @@ -231,7 +231,7 @@ public function testOrWhereJsonContainsKeyWithRelation(): void
->fetchOne();

$this->assertSame(1, $post->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
}

public function testWhereJsonDoesntContainKey(): void
Expand All @@ -240,7 +240,7 @@ public function testWhereJsonDoesntContainKey(): void
$user = $selector->whereJsonDoesntContainKey('settings->foo')->fetchOne();

$this->assertSame(2, $user->id);
$this->assertSame(['theme' => 'light'], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($user->settings, true));
}

public function testWhereJsonDoesntContainKeyWithRelation(): void
Expand All @@ -249,7 +249,7 @@ public function testWhereJsonDoesntContainKeyWithRelation(): void
$post = $selector->whereJsonDoesntContainKey('user.settings->foo')->fetchOne();

$this->assertSame(2, $post->id);
$this->assertSame(['theme' => 'light'], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($post->user->settings, true));
}

public function testOrWhereJsonDoesntContainKey(): void
Expand All @@ -261,7 +261,7 @@ public function testOrWhereJsonDoesntContainKey(): void
->fetchOne();

$this->assertSame(2, $user->id);
$this->assertSame(['theme' => 'light'], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($user->settings, true));
}

public function testOrWhereJsonDoesntContainKeyWithRelation(): void
Expand All @@ -273,7 +273,7 @@ public function testOrWhereJsonDoesntContainKeyWithRelation(): void
->fetchOne();

$this->assertSame(2, $post->id);
$this->assertSame(['theme' => 'light'], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'light'], \json_decode($post->user->settings, true));
}

public function testWhereJsonLength(): void
Expand All @@ -282,7 +282,7 @@ public function testWhereJsonLength(): void
$user = $selector->whereJsonLength('settings->foo', 2)->fetchOne();

$this->assertSame(1, $user->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
}

public function testWhereJsonLengthWithRelation(): void
Expand All @@ -291,7 +291,7 @@ public function testWhereJsonLengthWithRelation(): void
$post = $selector->whereJsonLength('user.settings->foo', 2)->fetchOne();

$this->assertSame(1, $post->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
}

public function testOrWhereJsonLength(): void
Expand All @@ -303,7 +303,7 @@ public function testOrWhereJsonLength(): void
->fetchOne();

$this->assertSame(1, $user->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($user->settings, true));
}

public function testOrWhereJsonLengthWithRelation(): void
Expand All @@ -315,6 +315,6 @@ public function testOrWhereJsonLengthWithRelation(): void
->fetchOne();

$this->assertSame(1, $post->id);
$this->assertSame(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
$this->assertEquals(['theme' => 'dark', 'foo' => ['bar', 'baz']], \json_decode($post->user->settings, true));
}
}

0 comments on commit bb3e289

Please sign in to comment.