Skip to content

Commit

Permalink
Create test for failing case
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Jul 26, 2016
1 parent 94e4a33 commit 58e7d55
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/QrCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@ public function testGetQrCodeWithLogoString()
$this->assertTrue(is_string($imageString));
}

/**
* For https://github.com/endroid/QrCode/issues/49
*/
public function testRenderHttpAddress()
{
$qrCode = new QrCode();
$qrCode
->setText('http://www.example.com/it/it/contact/qr/hit/id/1 ')
->setExtension('png')
->setSize(300)
->setPadding(10)
->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
->setErrorCorrection(QrCode::LEVEL_MEDIUM);

$qrCode->save('php://output');
}

/**
* Returns a QR code.
*/
Expand All @@ -86,6 +104,11 @@ protected function createQrCode()
return $qrCode;
}

/**
* Creates a QR code with a logo.
*
* @return QrCode
*/
protected function createQrCodeWithLogo()
{
$qrCode = new QrCode();
Expand Down

0 comments on commit 58e7d55

Please sign in to comment.