public function it_gets_the_full_form_path(Sanitizer $sanitizer, Filesystem $filesystem) { /* * This test duplicates some code as it also tests the makeSureFinalDirectoryExists */ define('DS', DIRECTORY_SEPARATOR); $details = ['namespace' => 'This\\Is\\The\\Test\\Namespace', 'dir' => 'This/Is/Yet/Another/Test/Directory', 'className' => 'FooBar']; $sanitizer->stripDoubleDirectorySeparators('This/Is/Yet/Another/Test/Directory/FooBarForm.php')->willReturn('This/Is/Yet/Another/Test/Directory/FooBarForm.php'); /* * Mock the filesystem and tell the method that the directory already exists otherwise it will go & create it */ $filesystem->isDirectory('This/Is/Yet/Another/Test/Directory')->willReturn(true); $this->getFullPath($sanitizer, $details, $filesystem)->shouldReturn('This/Is/Yet/Another/Test/Directory/FooBarForm.php'); }