Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace assertEquals by assertSame #11

Merged
merged 2 commits into from
Aug 22, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
docker pull ghcr.io/biigle/worker:latest

- name: Start test database
run: docker-compose up -d --no-build database_testing && sleep 5
run: docker compose up -d --no-build database_testing && sleep 5
working-directory: ../core

- name: Run tests
run: docker-compose run --rm -u 1001 worker php -d memory_limit=1G vendor/bin/phpunit --random-order --filter 'Biigle\\Tests\\Modules\\'${MODULE_NAME}
run: docker compose run --rm -u 1001 worker php -d memory_limit=1G vendor/bin/phpunit --random-order --filter 'Biigle\\Tests\\Modules\\'${MODULE_NAME}
working-directory: ../core
12 changes: 6 additions & 6 deletions test/Http/Controllers/Api/DemoProjectControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testStoreEmpty()

$project = $this->user()->projects()->first();
$this->assertNotNull($project);
$this->assertEquals('My demo project', $project->name);
$this->assertSame('My demo project', $project->name);
$this->assertStringContainsString("{$this->user()->firstname} {$this->user()->lastname}", $project->description);
$this->assertFalse($project->labelTrees()->exists());
$this->assertFalse($project->volumes()->exists());
Expand Down Expand Up @@ -60,7 +60,7 @@ public function testStoreWithLabelTree()
$this->post('/api/v1/projects/demo')->assertStatus(302);

$project = $this->user()->projects()->first();
$this->assertEquals($tree->id, $project->labelTrees()->first()->id);
$this->assertSame($tree->id, $project->labelTrees()->first()->id);
}

public function testStoreWithVolumes()
Expand All @@ -84,10 +84,10 @@ public function testStoreWithVolumes()
$volume = $this->user()->projects()->first()->volumes()->first();
$this->assertNotNull($volume);
$this->assertNotEquals($image->volume_id, $volume->id);
$this->assertEquals($image->volume->name, $volume->name);
$this->assertEquals($image->volume->url, $volume->url);
$this->assertEquals($image->filename, $volume->images()->first()->filename);
$this->assertEquals($volume->creator_id, $this->user()->id);
$this->assertSame($image->volume->name, $volume->name);
$this->assertSame($image->volume->url, $volume->url);
$this->assertSame($image->filename, $volume->images()->first()->filename);
$this->assertSame($volume->creator_id, $this->user()->id);
}

public function testStoreGuest()
Expand Down