Skip to content

Commit

Permalink
Add test case for Github issue #365
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Jan 31, 2022
1 parent f06706e commit 07bfc57
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
composer update --prefer-lowest
vendor/bin/unit-test
vendor/bin/functional-test ^4.4
vendor/bin/functional-test 4.4
- name: Archive logs
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -13,7 +13,7 @@
],
"require": {
"php": "^7.4||^8.0",
"bacon/bacon-qr-code": "^2.0"
"bacon/bacon-qr-code": "^2.0.5"
},
"require-dev": {
"ext-gd": "*",
Expand Down
25 changes: 25 additions & 0 deletions tests/BuilderTest.php
Expand Up @@ -40,4 +40,29 @@ public function testBuilder(): void
$this->assertInstanceOf(PngResult::class, $result);
$this->assertEquals('image/png', $result->getMimeType());
}

/**
* @testdox Github issue #365
*/
public function testGithubIssue365(): void
{
$data = 'test';
$size = 300;
$label = 'label';

$result = Builder::create()
->data($data)
->encoding(new Encoding('UTF-8'))
->errorCorrectionLevel(new ErrorCorrectionLevelHigh())
->size($size)
->margin(10)
->roundBlockSizeMode(new RoundBlockSizeModeMargin())
->labelText($label)
->labelFont(new NotoSans(20))
->labelAlignment(new LabelAlignmentCenter())
->build();

$this->assertInstanceOf(PngResult::class, $result);
$this->assertEquals('image/png', $result->getMimeType());
}
}

0 comments on commit 07bfc57

Please sign in to comment.