Skip to content

Commit ee46e2c

Browse files
authored
Merge pull request #84 from biigle/use-assertSame
Replace assertEquals by assertSame
2 parents c28b7ea + 74c0855 commit ee46e2c

5 files changed

+17
-18
lines changed

tests/ImageTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public function testConvert()
3535
'attrs' => [Image::LASERPOINTS_ATTRIBUTE => ['area' => 500]],
3636
]);
3737
$laserpointsImage = Image::convert($image);
38-
$this->assertEquals($image->id, $laserpointsImage->id);
38+
$this->assertSame($image->id, $laserpointsImage->id);
3939
$this->assertTrue($laserpointsImage instanceof Image);
40-
$this->assertEquals(500, $laserpointsImage->laserpoints['area']);
40+
$this->assertSame(500, $laserpointsImage->laserpoints['area']);
4141
}
4242

4343
public function testLaserpoints()
@@ -51,7 +51,7 @@ public function testLaserpoints()
5151
$expect = [
5252
'area' => 500,
5353
];
54-
$this->assertEquals($expect, $image->fresh()->laserpoints);
54+
$this->assertSame($expect, $image->fresh()->laserpoints);
5555
}
5656

5757
public function testAreaAttribute()
@@ -63,15 +63,15 @@ public function testAreaAttribute()
6363
'area' => 600,
6464
];
6565
$image->save();
66-
$this->assertEquals(600, $image->fresh()->area);
66+
$this->assertSame(600, $image->fresh()->area);
6767

6868
// Laser point detection overrides the metadata.
6969
$image->laserpoints = [
7070
'area' => 500,
7171
];
7272
$image->save();
7373

74-
$this->assertEquals(500, $image->fresh()->area);
74+
$this->assertSame(500, $image->fresh()->area);
7575
}
7676

7777
public function testLaserpointsNotThere()

tests/Jobs/ProcessDelphiJobTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ public function testHandle()
5353
with(new ProcessDelphiJob($this->image, 30, $this->gatherFile))->handle();
5454

5555
$expect = [
56+
'error' => false,
5657
'area' => 100,
5758
'count' => 3,
5859
'method' => 'delphi',
5960
'points' => [[100, 100], [200, 200], [300, 300]],
60-
'error' => false,
6161
'distance' => 30,
6262
];
6363

64-
$this->assertEquals($expect, $this->image->fresh()->laserpoints);
64+
$this->assertSame($expect, $this->image->fresh()->laserpoints);
6565
// Previously set attrs should not be lost.
66-
$this->assertEquals(1, $this->image->fresh()->attrs['a']);
66+
$this->assertSame(1, $this->image->fresh()->attrs['a']);
6767
}
6868

6969
public function testHandleGracefulError()
@@ -88,7 +88,7 @@ public function testHandleGracefulError()
8888
'distance' => 30,
8989
];
9090

91-
$this->assertEquals($expect, $this->image->fresh()->laserpoints);
91+
$this->assertSame($expect, $this->image->fresh()->laserpoints);
9292
}
9393

9494
public function testHandleFatalError()
@@ -121,6 +121,6 @@ public function testHandleFatalError()
121121
'distance' => 30,
122122
];
123123

124-
$this->assertEquals($expect, $this->image->fresh()->laserpoints);
124+
$this->assertSame($expect, $this->image->fresh()->laserpoints);
125125
}
126126
}

tests/Jobs/ProcessManualJobTest.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@ public function testHandle()
4444
with(new ProcessManualJob($this->image, $this->points, 30))->handle();
4545

4646
$expect = [
47+
'error' => false,
4748
'area' => 100,
4849
'count' => 3,
4950
'method' => 'manual',
5051
'points' => [[100, 100], [200, 200], [300, 300]],
51-
'error' => false,
5252
'distance' => 30,
5353
];
54-
55-
$this->assertEquals($expect, $this->image->fresh()->laserpoints);
54+
$this->assertSame($expect, $this->image->fresh()->laserpoints);
5655
// Previously set attributes should not be lost.
57-
$this->assertEquals(1, $this->image->fresh()->attrs['a']);
56+
$this->assertSame(1, $this->image->fresh()->attrs['a']);
5857
}
5958

6059
public function testHandleGracefulError()
@@ -79,7 +78,7 @@ public function testHandleGracefulError()
7978
'distance' => 30,
8079
];
8180

82-
$this->assertEquals($expect, $this->image->fresh()->laserpoints);
81+
$this->assertSame($expect, $this->image->fresh()->laserpoints);
8382
}
8483

8584
public function testHandleFatalError()
@@ -112,6 +111,6 @@ public function testHandleFatalError()
112111
'distance' => 30,
113112
];
114113

115-
$this->assertEquals($expect, $this->image->fresh()->laserpoints);
114+
$this->assertSame($expect, $this->image->fresh()->laserpoints);
116115
}
117116
}

tests/Jobs/ProcessVolumeDelphiJobTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testHandle()
4343

4444

4545
$expect = [$image->id => '[[0,0],[0,0],[0,0]]'];
46-
$this->assertEquals($expect, $job->points->toArray());
46+
$this->assertSame($expect, $job->points->toArray());
4747

4848
Bus::assertBatched(function (PendingBatch $batch) {
4949
return $batch->jobs->count() === 1 && $batch->jobs[0] instanceof ProcessDelphiJob;

tests/VolumeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testConvert()
1616
{
1717
$volume = BaseVolumeTest::create();
1818
$laserpointsVolume = Volume::convert($volume);
19-
$this->assertEquals($volume->id, $laserpointsVolume->id);
19+
$this->assertSame($volume->id, $laserpointsVolume->id);
2020
$this->assertTrue($laserpointsVolume instanceof Volume);
2121
}
2222

0 commit comments

Comments
 (0)