Blade CompilerTest Failing

Posted 3 months ago by Thavarshan

I've been testing the Laravel frameworks tests specifically the Blade compiler tests just so I can get an understanding of how things work. I'd like to make my own template compiler (Just for the sake of learning).

Four of the tests in the ViewBladeCompilerTest.php file fail and output the following:

Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_0_Illuminate_Filesystem_Filesystem::put('/Users/thavarshan/Codebase/Valet/framework/tests/View/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33.php', 'Hello World'). Either the method was unexpected or its arguments matched no expected argument list for this method


The test would be:

public function testCompileCompilesFileAndReturnsContents()
    $compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);

    $files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
        ->with(__DIR__ . '/' . sha1('foo') . '.php', "Hello World\n<?php /* foo */ ?>");


Anyone know why and how I can fix it?

I've been fiddling around with the code but haven't changed anything.

Please sign in or create an account to participate in this conversation.