Skip to content

Commit be862c7

Browse files
committed
Corrected tests
1 parent 7060f2b commit be862c7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Illuminate/View/Factory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public function exists($view)
323323
public function getEngineFromPath($path)
324324
{
325325
if ($this->hasPathEngine($path)) {
326-
return $this->pathEngines[$path];
326+
return $this->getPathEngine($path);
327327
}
328328

329329
if (! $extension = $this->getExtension($path)) {
@@ -334,7 +334,7 @@ public function getEngineFromPath($path)
334334

335335
$this->setPathEngine($path, $this->engines->resolve($engine));
336336

337-
return $this->pathEngines[$path];
337+
return $this->getPathEngine($path);
338338
}
339339

340340
/**
@@ -503,6 +503,11 @@ public function setPathEngine($path, $engine)
503503
$this->pathEngines[$path] = $engine;
504504
}
505505

506+
public function getPathEngine($path)
507+
{
508+
return $this->pathEngines[$path];
509+
}
510+
506511
public function hasPathEngine($path)
507512
{
508513
return isset($this->pathEngines[$path]);

tests/View/ViewFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ public function testMakeWithSlashAndDot()
842842
{
843843
$factory = $this->getFactory();
844844
$factory->getFinder()->shouldReceive('find')->twice()->with('foo.bar')->andReturn('path.php');
845-
$factory->getEngineResolver()->shouldReceive('resolve')->twice()->with('php')->andReturn(m::mock(Engine::class));
845+
$factory->getEngineResolver()->shouldReceive('resolve')->once()->with('php')->andReturn(m::mock(Engine::class));
846846
$factory->getDispatcher()->shouldReceive('hasListeners')->andReturn(false);
847847
$factory->make('foo/bar');
848848
$factory->make('foo.bar');
@@ -852,7 +852,7 @@ public function testNamespacedViewNamesAreNormalizedProperly()
852852
{
853853
$factory = $this->getFactory();
854854
$factory->getFinder()->shouldReceive('find')->twice()->with('vendor/package::foo.bar')->andReturn('path.php');
855-
$factory->getEngineResolver()->shouldReceive('resolve')->twice()->with('php')->andReturn(m::mock(Engine::class));
855+
$factory->getEngineResolver()->shouldReceive('resolve')->once()->with('php')->andReturn(m::mock(Engine::class));
856856
$factory->getDispatcher()->shouldReceive('hasListeners')->andReturn(false);
857857
$factory->make('vendor/package::foo/bar');
858858
$factory->make('vendor/package::foo.bar');

0 commit comments

Comments
 (0)