Skip to content

Commit

Permalink
Updated PHPUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Oct 25, 2017
1 parent fddb333 commit 69041df
Show file tree
Hide file tree
Showing 20 changed files with 138 additions and 117 deletions.
129 changes: 74 additions & 55 deletions test/FactoryTest.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/Object/Code25Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testBadTextAlwaysAllowed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand All @@ -97,7 +97,7 @@ public function testCheckGoodParams()

public function testCheckParamsWithLowRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0123456789');
$this->object->setBarThinWidth(21);
$this->object->setBarThickWidth(40);
Expand All @@ -106,7 +106,7 @@ public function testCheckParamsWithLowRatio()

public function testCheckParamsWithHighRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0123456789');
$this->object->setBarThinWidth(20);
$this->object->setBarThickWidth(61);
Expand Down
6 changes: 3 additions & 3 deletions test/Object/Code25interleavedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function testBadTextAlwaysAllowed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand All @@ -123,7 +123,7 @@ public function testCheckGoodParams()

public function testCheckParamsWithLowRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0123456789');
$this->object->setBarThinWidth(21);
$this->object->setBarThickWidth(40);
Expand All @@ -132,7 +132,7 @@ public function testCheckParamsWithLowRatio()

public function testCheckParamsWithHighRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0123456789');
$this->object->setBarThinWidth(20);
$this->object->setBarThickWidth(61);
Expand Down
6 changes: 3 additions & 3 deletions test/Object/Code39Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testBadTextAlwaysAllowed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('&');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand All @@ -90,7 +90,7 @@ public function testCheckGoodParams()

public function testCheckParamsWithLowRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('TEST');
$this->object->setBarThinWidth(21);
$this->object->setBarThickWidth(40);
Expand All @@ -99,7 +99,7 @@ public function testCheckParamsWithLowRatio()

public function testCheckParamsWithHighRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('TEST');
$this->object->setBarThinWidth(20);
$this->object->setBarThickWidth(61);
Expand Down
2 changes: 1 addition & 1 deletion test/Object/Ean13Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
2 changes: 1 addition & 1 deletion test/Object/Ean8Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
2 changes: 1 addition & 1 deletion test/Object/IdentcodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
6 changes: 3 additions & 3 deletions test/Object/Itf14Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand All @@ -89,7 +89,7 @@ public function testCheckGoodParams()

public function testCheckParamsWithLowRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0000123456789');
$this->object->setBarThinWidth(21);
$this->object->setBarThickWidth(40);
Expand All @@ -98,7 +98,7 @@ public function testCheckParamsWithLowRatio()

public function testCheckParamsWithHighRatio()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0000123456789');
$this->object->setBarThinWidth(20);
$this->object->setBarThickWidth(61);
Expand Down
2 changes: 1 addition & 1 deletion test/Object/LeitcodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
4 changes: 2 additions & 2 deletions test/Object/PlanetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testSetText()

public function testSetTextWithoutGoodNumberOfCharacters()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('1234');
$this->object->getText();
}
Expand Down Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
4 changes: 2 additions & 2 deletions test/Object/PostnetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testSetText()

public function testSetTextWithoutGoodNumberOfCharacters()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('1234');
$this->object->getText();
}
Expand Down Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
2 changes: 1 addition & 1 deletion test/Object/RoyalmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
31 changes: 16 additions & 15 deletions test/Object/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

namespace ZendTest\Barcode\Object;

use PHPUnit\Framework\TestCase;
use Zend\Barcode;
use Zend\Config;

abstract class TestCommon extends \PHPUnit_Framework_TestCase
abstract class TestCommon extends TestCase
{
/**
* @var \Zend\Barcode\Object\AbstractObject
Expand Down Expand Up @@ -102,7 +103,7 @@ public function testBarHeight()

public function testNegativeBarHeight()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setBarHeight(- 1);
}

Expand All @@ -118,7 +119,7 @@ public function testBarThinWidth()

public function testNegativeBarThinWidth()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setBarThinWidth(- 1);
}

Expand All @@ -134,7 +135,7 @@ public function testBarThickWidth()

public function testNegativeBarThickWidth()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setBarThickWidth(- 1);
}

Expand All @@ -152,7 +153,7 @@ public function testFactor()

public function testNegativeFactor()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setFactor(- 1);
}

Expand All @@ -166,13 +167,13 @@ public function testForeColor()

public function testNegativeForeColor()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setForeColor(- 1);
}

public function testTooHighForeColor()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setForeColor(16777126);
}

Expand All @@ -186,13 +187,13 @@ public function testBackgroundColor()

public function testNegativeBackgroundColor()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setBackgroundColor(- 1);
}

public function testTooHighBackgroundColor()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setBackgroundColor(16777126);
}

Expand Down Expand Up @@ -287,13 +288,13 @@ public function testSetFontAsNumberForGdImage()

public function testSetLowFontAsNumberForGdImage()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setFont(0);
}

public function testSetHighFontAsNumberForGdImage()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setFont(6);
}

Expand All @@ -305,7 +306,7 @@ public function testSetFontAsString()

public function testSetFontAsBoolean()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setFont(true);
}

Expand All @@ -316,7 +317,7 @@ public function testFontAsNumberWithoutGd()
'GD extension must not be loaded to run this test'
);
}
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setFont(1);
}

Expand All @@ -340,7 +341,7 @@ public function testFontSizeWithoutEffectWithGdInternalFont()

public function testStringFontSize()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setFontSize('22a');
}

Expand Down Expand Up @@ -438,7 +439,7 @@ public function testAddTextWithDefaultColor()

public function testCheckParamsFontWithOrientation()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('0');
$this->object->setFont(1);
$this->object->setOrientation(45);
Expand Down
2 changes: 1 addition & 1 deletion test/Object/UpcaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
2 changes: 1 addition & 1 deletion test/Object/UpceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testSetTextWithChecksumNotDisplayed()

public function testBadTextDetectedIfChecksumWished()
{
$this->setExpectedException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->expectException('\Zend\Barcode\Object\Exception\ExceptionInterface');
$this->object->setText('a');
$this->object->setWithChecksum(true);
$this->object->getText();
Expand Down
2 changes: 1 addition & 1 deletion test/ObjectPluginManagerCompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendTest\Barcode;

use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;
use Zend\Barcode\Exception\InvalidArgumentException;
use Zend\Barcode\Object\AbstractObject;
use Zend\Barcode\ObjectPluginManager;
Expand Down
Loading

0 comments on commit 69041df

Please sign in to comment.