Skip to content

Commit

Permalink
update TranslatorTest after Laravel changes to choice() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Nov 17, 2024
1 parent 76c096d commit 509c0ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Translation/TranslatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function testSetMethodCanOverwriteAnEntireGroupForALocale()
public function testChoiceMethodProperlyLoadsAndRetrievesItem()
{
$t = $this->getMockBuilder(Translator::class)->onlyMethods(['get', 'localeForChoice'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
$t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo(['replace']), $this->equalTo('en'))->willReturn('line');
$t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('en'))->willReturn('line');
$t->expects($this->once())->method('localeForChoice')->with($this->equalTo('foo'), $this->equalTo(null))->willReturn('en');
$t->setSelector($selector = m::mock(MessageSelector::class));
$selector->shouldReceive('choose')->once()->with('line', 10, 'en')->andReturn('choiced');
Expand All @@ -233,7 +233,7 @@ public function testChoiceMethodProperlyLoadsAndRetrievesItem()
public function testChoiceMethodProperlyCountsCollectionsAndLoadsAndRetrievesItem()
{
$t = $this->getMockBuilder(Translator::class)->onlyMethods(['get', 'localeForChoice'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
$t->expects($this->exactly(2))->method('get')->with($this->equalTo('foo'), $this->equalTo(['replace']), $this->equalTo('en'))->willReturn('line');
$t->expects($this->exactly(2))->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('en'))->willReturn('line');
$t->expects($this->exactly(2))->method('localeForChoice')->with($this->equalTo('foo'), $this->equalTo(null))->willReturn('en');
$t->setSelector($selector = m::mock(MessageSelector::class));
$selector->shouldReceive('choose')->twice()->with('line', 3, 'en')->andReturn('choiced');
Expand Down

0 comments on commit 509c0ba

Please sign in to comment.