Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
the code changes add an extra `exists()` call, so we'll adjust our numbers here.
  • Loading branch information
browner12 committed Oct 10, 2024
1 parent 1939a3a commit 9d90ad3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/View/Blade/BladeComponentTagCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public function testClasslessComponentsWithAnonymousComponentNamespace()
$container->instance(Factory::class, $factory = m::mock(Factory::class));

$app->shouldReceive('getNamespace')->once()->andReturn('App\\');
$factory->shouldReceive('exists')->times(3)->andReturnUsing(function ($arg) {
$factory->shouldReceive('exists')->times(4)->andReturnUsing(function ($arg) {
// In our test, we'll do as if the 'public.frontend.anonymous-component'
// view exists and not the others.
return $arg === 'public.frontend.anonymous-component';
Expand Down Expand Up @@ -580,7 +580,7 @@ public function testClasslessComponentsWithAnonymousComponentNamespaceWithIndexV
$container->instance(Factory::class, $factory = m::mock(Factory::class));

$app->shouldReceive('getNamespace')->once()->andReturn('App\\');
$factory->shouldReceive('exists')->times(4)->andReturnUsing(function (string $viewNameBeingCheckedForExistence) {
$factory->shouldReceive('exists')->times(5)->andReturnUsing(function (string $viewNameBeingCheckedForExistence) {
// In our test, we'll do as if the 'public.frontend.anonymous-component'
// view exists and not the others.
return $viewNameBeingCheckedForExistence === 'admin.auth.components.anonymous-component.index';
Expand Down Expand Up @@ -707,7 +707,7 @@ public function testItThrowsAnExceptionForNonExistingClass()
$container->instance(Application::class, $app = m::mock(Application::class));
$container->instance(Factory::class, $factory = m::mock(Factory::class));
$app->shouldReceive('getNamespace')->once()->andReturn('App\\');
$factory->shouldReceive('exists')->twice()->andReturn(false);
$factory->shouldReceive('exists')->times(3)->andReturn(false);
Container::setInstance($container);

$this->expectException(InvalidArgumentException::class);
Expand Down

0 comments on commit 9d90ad3

Please sign in to comment.