createTestDirectory(); $httpHelper = $this->mock( \Szurubooru\Helpers\HttpHelper::class); $fileService = new \Szurubooru\Services\FileService($testDirectory, $httpHelper); $input = 'data:text/plain,YXdlc29tZSBkb2c='; $fileService->saveFromBase64($input, 'dog.txt'); $expected = 'awesome dog'; $actual = file_get_contents($testDirectory . DIRECTORY_SEPARATOR . 'dog.txt'); $this->assertEquals($expected, $actual); } }