Skip to content

Commit

Permalink
bump deps, coveralls chg, use expectException
Browse files Browse the repository at this point in the history
Use expectException as phpunit 6 removed setExpectedException method
after it had been declared deprecated before.

bumping deps lead to coveralls not having the binary for coverage report
sending on travisci run anymore, thus I changed that to wget the binary
instead on CI and removed the dev-dependency to coveralls from composer.

refs #30
  • Loading branch information
graste committed Jan 30, 2018
1 parent 46efa5a commit 262d2b5
Show file tree
Hide file tree
Showing 19 changed files with 603 additions and 722 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ php:
- 7.1
- 7.2

before_install:
- travis_retry wget "https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar" --output-document="${HOME}/bin/php-coveralls" && chmod u+x "${HOME}/bin/php-coveralls"

before_script:
- composer install

script:
- composer build

after_script:
- php vendor/bin/coveralls -v
- bin/php-coveralls -v

notifications:
irc:
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@
"twig/twig": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^5.7 || ^6.0",
"phpmd/phpmd": "^2.6",
"squizlabs/php_codesniffer": "^2.8",
"mockery/mockery": "^0.9",
"satooshi/php-coveralls": "master@dev"
"mockery/mockery": "^1.0"
},
"autoload": {
"psr-4": { "Trellis\\": "src/" }
Expand Down
1,263 changes: 575 additions & 688 deletions composer.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions tests/CodeGen/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testBuildSchema()
)
);

$codegen_service->generate($this->schema_path);
$this->assertNull($codegen_service->generate($this->schema_path));
// @todo assert validity of the generated code inside the configured cache directory.
}

Expand All @@ -38,8 +38,8 @@ public function testDeployMethodMove()
)
);

$codegen_service->generate($this->schema_path);
$codegen_service->deploy($this->schema_path);
$this->assertNull($codegen_service->generate($this->schema_path));
$this->assertNull($codegen_service->deploy($this->schema_path));
// @todo assert validity of the generated code inside the configured deploy directory.
}

Expand All @@ -54,8 +54,8 @@ public function testDeployMethodCopy()
)
);

$codegen_service->generate($this->schema_path);
$codegen_service->deploy($this->schema_path);
$this->assertNull($codegen_service->generate($this->schema_path));
$this->assertNull($codegen_service->deploy($this->schema_path));
// @todo assert validity of the generated code inside the configured deploy directory.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function testToNativeRoundtrip()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new AssetListAttribute(
'assetinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testValueComparison()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new BooleanListAttribute(
'BooleanListInvalidDefault',
$this->getTypeMock(),
Expand All @@ -58,7 +58,7 @@ public function testThrowsOnInvalidDefaultValueInConfig()

public function testThrowsOnFunnyString()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new BooleanListAttribute(
'BooleanListInvalidDefault',
$this->getTypeMock(),
Expand Down
4 changes: 2 additions & 2 deletions tests/Runtime/Attribute/EmailList/EmailListAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function testAllowedPairsConstraintFails()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);

$attribute = new EmailListAttribute(
'emailinvalidintegerdefaultvalue',
Expand All @@ -199,7 +199,7 @@ public function testThrowsOnInvalidDefaultValueInConfig()

public function testThrowsOnInvalidEmailDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);

$attribute = new EmailListAttribute(
'emailinvaliddefaultvalue',
Expand Down
2 changes: 1 addition & 1 deletion tests/Runtime/Attribute/Float/FloatAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public function testToNativeNanRoundtrip()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new FloatAttribute(
'Floatinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Runtime/Attribute/GeoPoint/GeoPointAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function testSettingToNullAfterValidValueWasSetWorks()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new GeoPointAttribute(
'gpinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
8 changes: 0 additions & 8 deletions tests/Runtime/Attribute/GeoPoint/GeoPointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ public function testCreateFromPartialArrayFails()
]);
}

public function testCreateWithZeroCoordsSucceeds()
{
$gp = new GeoPoint([
GeoPoint::PROPERTY_LONGITUDE => 0,
GeoPoint::PROPERTY_LATITUDE => 0
]);
}

public function testCreateWithZeroCoordsIsTreatedAsNullIsland()
{
$gp = new GeoPoint([
Expand Down
2 changes: 1 addition & 1 deletion tests/Runtime/Attribute/HtmlLink/HtmlLinkAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testToNativeRoundtrip()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new HtmlLinkAttribute(
'linkinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testToNativeRoundtrip()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new HtmlLinkListAttribute(
'linkinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Runtime/Attribute/Image/ImageAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function testToNativeRoundtrip()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new ImageAttribute(
'imageinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function testToNativeRoundtrip()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new ImageListAttribute(
'imageinvaliddefaultvalue',
$this->getTypeMock(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Runtime/Attribute/Integer/IntegerAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function testMinMaxConstraint()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new IntegerAttribute(
self::ATTR_NAME,
$this->getTypeMock(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function testMinMaxConstraint()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);
$attribute = new IntegerListAttribute(
self::ATTR_NAME,
$this->getTypeMock(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public function testAllowedPairsConstraintFails()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);

$attribute = new KeyValueListAttribute(
'keyvalueinvalidintegerdefaultvalue',
Expand Down
4 changes: 2 additions & 2 deletions tests/Runtime/Attribute/TextList/TextListAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function testAllowedValuesConstraintFails()
*/
public function testThrowsOnInvalidDefaultValueInConfig($expected_exception, $invalid_default_value)
{
$this->setExpectedException($expected_exception);
$this->expectException($expected_exception);

$attribute = new TextListAttribute(
'asdf',
Expand All @@ -215,7 +215,7 @@ public function testGetNullValueOnMissingDefaultValueInConfig()
public function testThrowsOnMissingDefaultValueInConfig()
{
$attribute = new TextListAttribute('TextListwrongtypeargument', $this->getTypeMock());
$this->setExpectedException(InvalidTypeException::CLASS);
$this->expectException(InvalidTypeException::CLASS);

$valueholder = $attribute->createValueHolder('false');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Runtime/Attribute/UrlList/UrlListAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testMaxCountConstraint()

public function testThrowsOnInvalidDefaultValueInConfig()
{
$this->setExpectedException(BadValueException::CLASS);
$this->expectException(BadValueException::CLASS);

$attribute = new UrlListAttribute(
'urllistinvaliddefaultvalue',
Expand Down

0 comments on commit 262d2b5

Please sign in to comment.