Skip to content

Commit 0fcf68d

Browse files
Removed mockery; added phpunit as dependency
1 parent d4244a8 commit 0fcf68d

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.0",
20-
"mockery/mockery": "^0.9.9"
20+
"phpunit/phpunit": "^6.0"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "^6.0"

tests/Unit/SnapshotTest.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,25 @@
22

33
namespace Spatie\Snapshots\Test\Unit;
44

5-
use Mockery;
65
use PHPUnit\Framework\TestCase;
76
use Spatie\Snapshots\Driver;
87
use Spatie\Snapshots\Filesystem;
98
use Spatie\Snapshots\Snapshot;
109

1110
class SnapshotTest extends TestCase
1211
{
13-
/** @var \Mockery\MockInterface */
12+
/** @var \PHPUnit_Framework_MockObject_MockObject */
1413
private $filesystem;
1514

16-
/** @var \Mockery\MockInterface */
15+
/** @var \PHPUnit_Framework_MockObject_MockObject */
1716
private $driver;
1817

1918
public function setUp()
2019
{
2120
parent::setUp();
2221

23-
$this->filesystem = Mockery::mock(Filesystem::class);
24-
$this->driver = Mockery::mock(Driver::class);
25-
}
26-
27-
public function tearDown()
28-
{
29-
Mockery::close();
22+
$this->filesystem = $this->createMock(Filesystem::class);
23+
$this->driver = $this->createMock(Driver::class);
3024
}
3125

3226
/** @test */
@@ -40,8 +34,11 @@ public function it_has_an_id()
4034
/** @test */
4135
public function it_has_a_filename_based_on_its_id_and_its_drivers_extension()
4236
{
43-
$this->driver->shouldReceive('extension')->andReturn('.php');
44-
37+
$this->driver
38+
->expects($this->once())
39+
->method('extension')
40+
->willReturn('.php');
41+
4542
$snapshot = new Snapshot('abc', $this->filesystem, $this->driver);
4643

4744
$this->assertEquals('abc.php', $snapshot->filename());

0 commit comments

Comments
 (0)