Skip to content

Commit 1c2b060

Browse files
committed
minor #127 fix PHPUnit deprecations (keradus)
This PR was squashed before being merged into the 1.0-dev branch (closes #127). Discussion ---------- fix PHPUnit deprecations Commits ------- f7c3d3d fix PHPUnit deprecations
2 parents 462d076 + f7c3d3d commit 1c2b060

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

tests/Gitonomy/Git/Tests/RepositoryTest.php

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Gitonomy\Git\Blob;
1515
use Gitonomy\Git\Repository;
16+
use Prophecy\Argument;
1617

1718
class RepositoryTest extends AbstractTest
1819
{
@@ -62,17 +63,17 @@ public function testLoggerOk($repository)
6263
$this->markTestSkipped();
6364
}
6465

65-
$logger = $this->getMock('Psr\Log\LoggerInterface');
66-
$logger
67-
->expects($this->once())
68-
->method('info')
66+
$loggerProphecy = $this->prophesize('Psr\Log\LoggerInterface');
67+
$loggerProphecy
68+
->info('run command: remote "" ')
69+
->shouldBeCalledTimes(1)
6970
;
70-
$logger
71-
->expects($this->exactly(3)) // duration, return code and output
72-
->method('debug')
71+
$loggerProphecy
72+
->debug(Argument::type('string')) // duration, return code and output
73+
->shouldBeCalledTimes(3)
7374
;
7475

75-
$repository->setLogger($logger);
76+
$repository->setLogger($loggerProphecy->reveal());
7677

7778
$repository->run('remote');
7879
}
@@ -87,21 +88,21 @@ public function testLoggerNOk($repository)
8788
$this->markTestSkipped();
8889
}
8990

90-
$logger = $this->getMock('Psr\Log\LoggerInterface');
91-
$logger
92-
->expects($this->once())
93-
->method('info')
91+
$loggerProphecy = $this->prophesize('Psr\Log\LoggerInterface');
92+
$loggerProphecy
93+
->info(Argument::type('string'))
94+
->shouldBeCalledTimes(1)
9495
;
95-
$logger
96-
->expects($this->exactly(3)) // duration, return code and output
97-
->method('debug')
96+
$loggerProphecy
97+
->debug(Argument::type('string')) // duration, return code and output
98+
->shouldBeCalledTimes(3)
9899
;
99-
$logger
100-
->expects($this->once())
101-
->method('error')
100+
$loggerProphecy
101+
->error(Argument::type('string'))
102+
->shouldBeCalledTimes(1)
102103
;
103104

104-
$repository->setLogger($logger);
105+
$repository->setLogger($loggerProphecy->reveal());
105106

106107
$repository->run('not-work');
107108
}

0 commit comments

Comments
 (0)