Skip to content

Commit

Permalink
Allow PHP 7.2 & 7.3 and PHPUnit 6
Browse files Browse the repository at this point in the history
  • Loading branch information
VolCh authored and javiereguiluz committed Nov 28, 2017
1 parent 001619d commit 35f5008
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ matrix:
fast_finish: true
include:
- php: 7.1
- php: 7.2
- php: nightly
allow_failures:
- php: nightly

before_install:
- phpenv config-rm xdebug.ini
- '[[ "$TRAVIS_PHP_VERSION" == "nightly" ]] || phpenv config-rm xdebug.ini'
- composer self-update

install:
Expand All @@ -26,7 +30,7 @@ install:
script:
- ./vendor/bin/simple-phpunit
# this checks that the source code follows the Symfony Code Syntax rules
- ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
- '[[ "$TRAVIS_PHP_VERSION" == "nightly" ]] || ./vendor/bin/php-cs-fixer fix --diff --dry-run -v'
# this checks that the YAML config files contain no syntax errors
- ./bin/console lint:yaml config
# this checks that the Twig template files contain no syntax errors
Expand Down
21 changes: 14 additions & 7 deletions tests/Utils/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ public function testValidateUsername()

public function testValidateUsernameEmpty()
{
$this->setExpectedException('Exception', 'The username can not be empty.');
$this->expectException('Exception');
$this->expectExceptionMessage('The username can not be empty.');
$this->object->validateUsername(null);
}

public function testValidateUsernameInvalid()
{
$this->setExpectedException('Exception', 'The username must contain only lowercase latin characters and underscores.');
$this->expectException('Exception');
$this->expectExceptionMessage('The username must contain only lowercase latin characters and underscores.');
$this->object->validateUsername('INVALID');
}

Expand All @@ -53,13 +55,15 @@ public function testValidatePassword()

public function testValidatePasswordEmpty()
{
$this->setExpectedException('Exception', 'The password can not be empty.');
$this->expectException('Exception');
$this->expectExceptionMessage('The password can not be empty.');
$this->object->validatePassword(null);
}

public function testValidatePasswordInvalid()
{
$this->setExpectedException('Exception', 'The password must be at least 6 characters long.');
$this->expectException('Exception');
$this->expectExceptionMessage('The password must be at least 6 characters long.');
$this->object->validatePassword('12345');
}

Expand All @@ -72,13 +76,15 @@ public function testValidateEmail()

public function testValidateEmailEmpty()
{
$this->setExpectedException('Exception', 'The email can not be empty.');
$this->expectException('Exception');
$this->expectExceptionMessage('The email can not be empty.');
$this->object->validateEmail(null);
}

public function testValidateEmailInvalid()
{
$this->setExpectedException('Exception', 'The email should look like a real email.');
$this->expectException('Exception');
$this->expectExceptionMessage('The email should look like a real email.');
$this->object->validateEmail('invalid');
}

Expand All @@ -91,7 +97,8 @@ public function testValidateFullName()

public function testValidateEmailFullName()
{
$this->setExpectedException('Exception', 'The full name can not be empty.');
$this->expectException('Exception');
$this->expectExceptionMessage('The full name can not be empty.');
$this->object->validateFullName(null);
}
}

0 comments on commit 35f5008

Please sign in to comment.