Updated phpunit tests for phpunit v7

This commit is contained in:
alext 2018-11-03 17:10:34 +01:00
parent 9e9565400d
commit a1ae0f3746
15 changed files with 66 additions and 37 deletions

View file

@ -13,9 +13,10 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
use \EA\Engine\Types\NonEmptyText; use EA\Engine\Type\NonEmptyText;
use PHPUnit\Framework\TestCase;
class AuthorizationTest extends \PHPUnit_Framework_TestCase { class AuthorizationTest extends TestCase {
public function testBasicMethodPerformsBasicAuthentication() public function testBasicMethodPerformsBasicAuthentication()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -13,7 +13,9 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
class FilterTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class FilterTest extends TestCase {
public function test() public function test()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -13,7 +13,9 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
class MinimizeTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class MinimizeTest extends TestCase {
public function test() public function test()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -13,7 +13,9 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
class PaginationTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class PaginationTest extends TestCase {
public function test() public function test()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -13,7 +13,9 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
class ResponseTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class ResponseTest extends TestCase {
public function test() public function test()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -13,7 +13,9 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
class SearchTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class SearchTest extends TestCase {
public function test() public function test()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -13,7 +13,9 @@
namespace EA\Engine\Api\V1; namespace EA\Engine\Api\V1;
class SortTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class SortTest extends TestCase {
public function test() public function test()
{ {
$this->markTestIncomplete(); $this->markTestIncomplete();

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class BooleanTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class BooleanTest extends TestCase {
public function testBoolType() public function testBoolType()
{ {
$type = new Boolean(TRUE); $type = new Boolean(TRUE);
@ -22,7 +24,7 @@ class BooleanTest extends \PHPUnit_Framework_TestCase {
public function testBoolTypeThrowsExceptionWithInvalidValue() public function testBoolTypeThrowsExceptionWithInvalidValue()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Boolean(NULL); new Boolean(NULL);
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class DecimalTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class DecimalTest extends TestCase {
public function testFloatType() public function testFloatType()
{ {
$type = new Decimal(100.00); $type = new Decimal(100.00);
@ -22,7 +24,7 @@ class DecimalTest extends \PHPUnit_Framework_TestCase {
public function testFloatTypeThrowsExceptionWithInvalidValue() public function testFloatTypeThrowsExceptionWithInvalidValue()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Decimal(NULL); new Decimal(NULL);
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class EmailTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class EmailTest extends TestCase {
public function testEmailType() public function testEmailType()
{ {
$type = new Email('john@doe.com'); $type = new Email('john@doe.com');
@ -22,13 +24,13 @@ class EmailTest extends \PHPUnit_Framework_TestCase {
public function testEmailTypeThrowsExceptionWithInvalidEmail() public function testEmailTypeThrowsExceptionWithInvalidEmail()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Email('abcdef'); new Email('abcdef');
} }
public function testEmailTypeThrowsExceptionWithInvalidValue() public function testEmailTypeThrowsExceptionWithInvalidValue()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Email(NULL); new Email(NULL);
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class IntegerTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class IntegerTest extends TestCase {
public function testIntType() public function testIntType()
{ {
$type = new Integer(1); $type = new Integer(1);
@ -22,13 +24,13 @@ class IntegerTest extends \PHPUnit_Framework_TestCase {
public function testIntTypeThrowsExceptionWithFloat() public function testIntTypeThrowsExceptionWithFloat()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Integer(100.00); new Integer(100.00);
} }
public function testIntTypeThrowsExceptionWithWithString() public function testIntTypeThrowsExceptionWithWithString()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Integer('invalid'); new Integer('invalid');
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class NonEmptyAlphanumericTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class NonEmptyTextTest extends TestCase {
public function testNonEmptyStringType() public function testNonEmptyStringType()
{ {
$type = new NonEmptyText('Hello!'); $type = new NonEmptyText('Hello!');
@ -22,13 +24,13 @@ class NonEmptyAlphanumericTest extends \PHPUnit_Framework_TestCase {
public function testNonEmptyStringTypeThrowsExceptionWithEmptyString() public function testNonEmptyStringTypeThrowsExceptionWithEmptyString()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new NonEmptyText(''); new NonEmptyText('');
} }
public function testNonEmptyStringTypeThrowsExceptionWithInvalidValue() public function testNonEmptyStringTypeThrowsExceptionWithInvalidValue()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new NonEmptyText(NULL); new NonEmptyText(NULL);
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class TextTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class TextTest extends TestCase {
public function testStringType() public function testStringType()
{ {
$type = new Text('Hello!'); $type = new Text('Hello!');
@ -22,7 +24,7 @@ class TextTest extends \PHPUnit_Framework_TestCase {
public function testStringTypeThrowsExceptionWithInvalidValue() public function testStringTypeThrowsExceptionWithInvalidValue()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Text(NULL); new Text(NULL);
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class UnsignedIntegerTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class UnsignedIntegerTest extends TestCase {
public function testUnsignedIntType() public function testUnsignedIntType()
{ {
$type = new UnsignedInteger(1); $type = new UnsignedInteger(1);
@ -22,13 +24,13 @@ class UnsignedIntegerTest extends \PHPUnit_Framework_TestCase {
public function testUnsignedIntTypeThrowsExceptionWithNegative() public function testUnsignedIntTypeThrowsExceptionWithNegative()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new UnsignedInteger(-1); new UnsignedInteger(-1);
} }
public function testUnsignedIntTypeThrowsExceptionWithWithString() public function testUnsignedIntTypeThrowsExceptionWithWithString()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new UnsignedInteger('invalid'); new UnsignedInteger('invalid');
} }
} }

View file

@ -11,9 +11,11 @@
* @since v1.2.0 * @since v1.2.0
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
namespace EA\Engine\Types; namespace EA\Engine\Type;
class UrlTest extends \PHPUnit_Framework_TestCase { use PHPUnit\Framework\TestCase;
class UrlTest extends TestCase {
public function testUrlType() public function testUrlType()
{ {
$type = new Url('http://localhost'); $type = new Url('http://localhost');
@ -22,13 +24,13 @@ class UrlTest extends \PHPUnit_Framework_TestCase {
public function testUrlTypeThrowsExceptionWithInvalidUrl() public function testUrlTypeThrowsExceptionWithInvalidUrl()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Url('abcdef'); new Url('abcdef');
} }
public function testUrlTypeThrowsExceptionWithInvalidValue() public function testUrlTypeThrowsExceptionWithInvalidValue()
{ {
$this->setExpectedException('\InvalidArgumentException'); $this->expectException(\InvalidArgumentException::class);
new Url(NULL); new Url(NULL);
} }
} }