Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/e2e/Adapter/MirrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testGetMirrorSource(): void
$database = $this->getDatabase();
$source = $database->getSource();
$this->assertInstanceOf(Database::class, $source);
$this->assertEquals(self::$source, $source);
$this->assertSame(self::$source, $source);
}

/**
Expand All @@ -124,7 +124,7 @@ public function testGetMirrorDestination(): void
$database = $this->getDatabase();
$destination = $database->getDestination();
$this->assertInstanceOf(Database::class, $destination);
$this->assertEquals(self::$destination, $destination);
$this->assertSame(self::$destination, $destination);
}

/**
Expand Down Expand Up @@ -170,12 +170,12 @@ public function testUpdateMirroredCollection(): void
);

// Asset both databases have updated the collection
$this->assertEquals(
$this->assertSame(
[Permission::read(Role::users())],
$database->getSource()->getCollection('testUpdateMirroredCollection')->getPermissions()
);

$this->assertEquals(
$this->assertSame(
[Permission::read(Role::users())],
$database->getDestination()->getCollection('testUpdateMirroredCollection')->getPermissions()
);
Expand Down Expand Up @@ -224,12 +224,12 @@ public function testCreateMirroredDocument(): void
]));

// Assert document is created in both databases
$this->assertEquals(
$this->assertSame(
$document,
$database->getSource()->getDocument('testCreateMirroredDocument', $document->getId())
);

$this->assertEquals(
$this->assertSame(
$document,
$database->getDestination()->getDocument('testCreateMirroredDocument', $document->getId())
);
Expand Down Expand Up @@ -273,12 +273,12 @@ public function testUpdateMirroredDocument(): void
);

// Assert document is updated in both databases
$this->assertEquals(
$this->assertSame(
$document,
$database->getSource()->getDocument('testUpdateMirroredDocument', $document->getId())
);

$this->assertEquals(
$this->assertSame(
$document,
$database->getDestination()->getDocument('testUpdateMirroredDocument', $document->getId())
);
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/Adapter/MongoDBTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public function testCreateExistsDelete(): void
{
// Mongo creates databases on the fly, so exists would always pass. So we override this test to remove the exists check.
$this->assertNotNull($this->getDatabase()->create());
$this->assertEquals(true, $this->getDatabase()->delete($this->testDatabase));
$this->assertEquals(true, $this->getDatabase()->create());
$this->assertEquals($this->getDatabase(), $this->getDatabase()->setDatabase($this->testDatabase));
$this->assertSame(true, $this->getDatabase()->delete($this->testDatabase));
$this->assertSame(true, $this->getDatabase()->create());
$this->assertSame($this->getDatabase(), $this->getDatabase()->setDatabase($this->testDatabase));
}

public function testRenameAttribute(): void
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/Adapter/Schemaless/MongoDBTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public function testCreateExistsDelete(): void
{
// Mongo creates databases on the fly, so exists would always pass. So we override this test to remove the exists check.
$this->assertNotNull(static::getDatabase()->create());
$this->assertEquals(true, $this->getDatabase()->delete($this->testDatabase));
$this->assertEquals(true, $this->getDatabase()->create());
$this->assertEquals($this->getDatabase(), $this->getDatabase()->setDatabase($this->testDatabase));
$this->assertSame(true, $this->getDatabase()->delete($this->testDatabase));
$this->assertSame(true, $this->getDatabase()->create());
$this->assertSame($this->getDatabase(), $this->getDatabase()->setDatabase($this->testDatabase));
}

public function testRenameAttribute(): void
Expand Down
508 changes: 254 additions & 254 deletions tests/e2e/Adapter/Scopes/AttributeTests.php

Large diffs are not rendered by default.

272 changes: 136 additions & 136 deletions tests/e2e/Adapter/Scopes/CollectionTests.php

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions tests/e2e/Adapter/Scopes/CustomDocumentTypeTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testSetDocumentType(): void

$database->setDocumentType('users', TestUser::class);

$this->assertEquals(
$this->assertSame(
TestUser::class,
$database->getDocumentType('users')
);
Expand Down Expand Up @@ -98,7 +98,7 @@ public function testClearDocumentType(): void
$database = static::getDatabase();

$database->setDocumentType('users', TestUser::class);
$this->assertEquals(TestUser::class, $database->getDocumentType('users'));
$this->assertSame(TestUser::class, $database->getDocumentType('users'));

$database->clearDocumentType('users');
$this->assertNull($database->getDocumentType('users'));
Expand All @@ -112,8 +112,8 @@ public function testClearAllDocumentTypes(): void
$database->setDocumentType('users', TestUser::class);
$database->setDocumentType('posts', TestPost::class);

$this->assertEquals(TestUser::class, $database->getDocumentType('users'));
$this->assertEquals(TestPost::class, $database->getDocumentType('posts'));
$this->assertSame(TestUser::class, $database->getDocumentType('users'));
$this->assertSame(TestPost::class, $database->getDocumentType('posts'));

$database->clearAllDocumentTypes();

Expand All @@ -134,8 +134,8 @@ public function testMethodChaining(): void
->setDocumentType('users', TestUser::class)
->setDocumentType('posts', TestPost::class);

$this->assertEquals(TestUser::class, $database->getDocumentType('users'));
$this->assertEquals(TestPost::class, $database->getDocumentType('posts'));
$this->assertSame(TestUser::class, $database->getDocumentType('users'));
$this->assertSame(TestPost::class, $database->getDocumentType('posts'));

// Cleanup to prevent test pollution
$database->clearAllDocumentTypes();
Expand Down Expand Up @@ -171,15 +171,15 @@ public function testCustomDocumentTypeWithGetDocument(): void

// Verify it's a TestUser instance
$this->assertInstanceOf(TestUser::class, $created);
$this->assertEquals('test@example.com', $created->getEmail());
$this->assertEquals('Test User', $created->getName());
$this->assertSame('test@example.com', $created->getEmail());
$this->assertSame('Test User', $created->getName());
$this->assertTrue($created->isActive());

// Get document and verify type
/** @var TestUser $fetched */
$fetched = $database->getDocument('customUsers', $created->getId());
$this->assertInstanceOf(TestUser::class, $fetched);
$this->assertEquals('test@example.com', $fetched->getEmail());
$this->assertSame('test@example.com', $fetched->getEmail());
$this->assertTrue($fetched->isActive());

// Cleanup
Expand Down Expand Up @@ -226,8 +226,8 @@ public function testCustomDocumentTypeWithFind(): void
$this->assertCount(2, $posts);
$this->assertInstanceOf(TestPost::class, $posts[0]);
$this->assertInstanceOf(TestPost::class, $posts[1]);
$this->assertEquals('First Post', $posts[0]->getTitle());
$this->assertEquals('Second Post', $posts[1]->getTitle());
$this->assertSame('First Post', $posts[0]->getTitle());
$this->assertSame('Second Post', $posts[1]->getTitle());

// Cleanup
$database->deleteCollection('customPosts');
Expand Down Expand Up @@ -274,8 +274,8 @@ public function testCustomDocumentTypeWithUpdateDocument(): void

// Verify it's still TestUser and has updated values
$this->assertInstanceOf(TestUser::class, $updated);
$this->assertEquals('updated@example.com', $updated->getEmail());
$this->assertEquals('Updated Name', $updated->getName());
$this->assertSame('updated@example.com', $updated->getEmail());
$this->assertSame('Updated Name', $updated->getName());
$this->assertFalse($updated->isActive());

// Cleanup
Expand Down
Loading
Loading