qrcodeService = $this->app->make('App\Services\QrCodeService'); } /** * @test */ public function test_encode_returns_correct_value() { // $rendered = $this->qrcodeService->encode(self::STRING_TO_ENCODE); $this->assertEquals(self::STRING_ENCODED, $this->qrcodeService->encode(self::STRING_TO_ENCODE)); } /** * @test */ public function test_decode_valid_image_returns_correct_value() { $file = LocalFile::fake()->validQrcode(); $this->assertEquals(self::DECODED_IMAGE, $this->qrcodeService->decode($file)); } /** * @test */ public function test_decode_invalid_image_returns_correct_value() { $this->expectException(\App\Exceptions\InvalidQrCodeException::class); $this->qrcodeService->decode(LocalFile::fake()->invalidQrcode()); } }