Skip to content

Commit

Permalink
normalizing binaries on gradfiet tests, revert debug on blade tes
Browse files Browse the repository at this point in the history
  • Loading branch information
2amjsouza committed Dec 8, 2023
1 parent b875a88 commit 833c5d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
3 changes: 1 addition & 2 deletions tests/_laravel/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

Route::name('app.')->prefix('/')->group(function () {
Route::name('blade')->get('/', function() {
abort(500);
//return view('blade-components');
return view('blade-components');
});
Route::name('label')->get('/label', function() {
return view('label');
Expand Down
3 changes: 0 additions & 3 deletions tests/laravel-functional/BladeComponentCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ public function testQrCodeComponentSimpleText(FunctionalTester $I)
{
$I->wantTo('Blade Component: Assert simple text QR Code creation');
$I->amOnPage('/');
$source = $I->grabPageSource();
var_dump($source);
$qrCode = file_get_contents(codecept_data_dir('blade/qrcode-blade.png'));

$I->seeInSource(base64_encode($qrCode));
}

Expand Down
19 changes: 17 additions & 2 deletions tests/unit/LaravelQrCodeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public function testCreateGradientQrCode()

$uri = file_get_contents(codecept_data_dir('blade/qrcode-gradient.png'));

$this->assertEquals($qrCode, $uri);
$this->assertEquals(
$this->normalizeString($qrCode),
$this->normalizeString($uri)
);

$qrCodeRadial = LaravelQrCodeFactory::make(
'2am. Technologies',
Expand All @@ -79,6 +82,18 @@ public function testCreateGradientQrCode()

$uri = file_get_contents(codecept_data_dir('blade/qrcode-gradient-radial.png'));

$this->assertEquals($qrCodeRadial, $uri);
$this->assertEquals(
$this->normalizeString($qrCodeRadial),
$this->normalizeString($uri)
);
}

protected function normalizeString($string)
{
return str_replace(
"\r\n", "\n", str_replace(
"
", "", $string
)
);
}
}

0 comments on commit 833c5d1

Please sign in to comment.