Skip to content

Commit

Permalink
revert string normalized
Browse files Browse the repository at this point in the history
  • Loading branch information
2amjsouza committed Dec 7, 2023
1 parent 36ad0ac commit fdf264b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions tests/_laravel/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
| into the script here so we don't need to manually load our classes.
|
*/
require __DIR__.'/../../../vendor/autoload.php';
require __DIR__.'/../vendor/autoload.php';

/*
Expand Down
23 changes: 7 additions & 16 deletions tests/laravel-functional/BladeComponentCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testQrCodeComponentSimpleText(FunctionalTester $I)
$I->wantTo('Blade Component: Assert simple text QR Code creation');
$I->amOnRoute('app.blade');

$qrCode = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-blade.png')));
$qrCode = file_get_contents(codecept_data_dir('blade/qrcode-blade.png'));

$I->seeInSource(base64_encode($qrCode));
}
Expand All @@ -80,8 +80,8 @@ public function testQrCodeComponentWithImage(FunctionalTester $I)
{
$I->wantTo('Blade Component: Assert QR Code with Logo creation');
$I->amOnRoute('app.logo');
$qrCode = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-logo.png')));
$qrCode2 = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-logo2.png')));
$qrCode = file_get_contents(codecept_data_dir('blade/qrcode-logo.png'));
$qrCode2 = file_get_contents(codecept_data_dir('blade/qrcode-logo2.png'));
$I->seeInSource(base64_encode($qrCode));
$I->seeInSource(base64_encode($qrCode2));
}
Expand All @@ -90,8 +90,8 @@ public function testQrCodeComponentWithPath(FunctionalTester $I)
{
$I->wantTo('Blade Component: Assert QR Code with Path Style creation');
$I->amOnRoute('app.path');
$qrCodeDots = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-dots.png')));
$qrCodeRounded = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-rounded.png')));
$qrCodeDots = file_get_contents(codecept_data_dir('blade/qrcode-dots.png'));
$qrCodeRounded = file_get_contents(codecept_data_dir('blade/qrcode-rounded.png'));
$I->seeInSource(base64_encode($qrCodeDots));
$I->seeInSource(base64_encode($qrCodeRounded));
}
Expand All @@ -100,18 +100,9 @@ public function testQrCodeComponentWithColors(FunctionalTester $I)
{
$I->wantTo('Blade Component: Assert QR Code with Colors creation');
$I->amOnRoute('app.colors');
$qrCodeBackground = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-background.png')));
$qrCodeForeground = $this->normalizeString(file_get_contents(codecept_data_dir('blade/qrcode-foreground.png')));
$qrCodeBackground = file_get_contents(codecept_data_dir('blade/qrcode-background.png'));
$qrCodeForeground = file_get_contents(codecept_data_dir('blade/qrcode-foreground.png'));
$I->seeInSource(base64_encode($qrCodeBackground));
$I->seeInSource(base64_encode($qrCodeForeground));
}

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

0 comments on commit fdf264b

Please sign in to comment.