Skip to content

Commit

Permalink
Tweak tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Apr 29, 2018
1 parent 1199e0a commit 371f637
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/Unit/AssetTest.php
Expand Up @@ -58,8 +58,8 @@ public function it_can_construct_dispatcher()
],
];

$dispatcher->shouldReceive('run')->twice()->with('script', $assets, null)->andReturn('scripted')
->shouldReceive('run')->twice()->with('style', $assets, null)->andReturn('styled');
$dispatcher->shouldReceive('run')->times(3)->with('script', $assets, null)->andReturn('scripted')
->shouldReceive('run')->times(3)->with('style', $assets, null)->andReturn('styled');

$stub = new Asset('default', $dispatcher);

Expand All @@ -72,6 +72,7 @@ public function it_can_construct_dispatcher()
$this->assertEquals('scripted', $stub->scripts());
$this->assertEquals('styled', $stub->styles());
$this->assertEquals('scriptedstyled', $stub->show());
$this->assertEquals('scriptedstyled', $stub->toHtml());
}

/** @test */
Expand All @@ -82,13 +83,14 @@ public function it_can_declare_prefix_for_assets()
$prefix = '//ajax.googleapis.com/ajax/libs/';
$assets = [];

$dispatcher->shouldReceive('run')->once()->with('script', $assets, $prefix)->andReturn('scripted')
->shouldReceive('run')->once()->with('style', $assets, $prefix)->andReturn('styled');
$dispatcher->shouldReceive('run')->twice()->with('script', $assets, $prefix)->andReturn('scripted')
->shouldReceive('run')->twice()->with('style', $assets, $prefix)->andReturn('styled');

$stub = new Asset('default', $dispatcher);
$stub->prefix($prefix);

$this->assertEquals('scriptedstyled', $stub->show());
$this->assertEquals('scriptedstyled', $stub->toHtml());
}

/**
Expand Down

0 comments on commit 371f637

Please sign in to comment.