Skip to content

Commit db2cad8

Browse files
committed
check project property values type
1 parent 65ba3ad commit db2cad8

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"require-dev": {
1818
"consistence/coding-standard": "3.10.1",
19+
"consistence/consistence": "2.0.2",
1920
"maglnet/composer-require-checker": "2.0",
2021
"php-parallel-lint/php-console-highlighter": "1.0",
2122
"php-parallel-lint/php-parallel-lint": "1.3.2",

tests/SymfonyCommandTaskIntegrationTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace VasekPurchart\Phing\SymfonyCommand;
66

7+
use Consistence\Type\Type;
78
use Generator;
89
use PHPUnit\Framework\Assert;
910
use Project;
@@ -84,10 +85,15 @@ public function testCallCommand(
8485
$tester = new PhingTester(__DIR__ . '/symfony-command-task-integration-test.xml');
8586
$tester->executeTarget($target);
8687

88+
$expectedExecutable = $tester->getProject()->getProperty($propertyNameWithExpectedExecutable);
89+
$expectedApp = $tester->getProject()->getProperty($propertyNameWithExpectedApp);
90+
Type::checkType($expectedExecutable, 'string');
91+
Type::checkType($expectedApp, 'string');
92+
8793
$tester->assertLogMessageRegExp(sprintf(
8894
'~executing.+%s.+%s.+hello:world~i',
89-
$tester->getProject()->getProperty($propertyNameWithExpectedExecutable),
90-
$tester->getProject()->getProperty($propertyNameWithExpectedApp)
95+
$expectedExecutable,
96+
$expectedApp
9197
), $target, Project::MSG_VERBOSE);
9298
}
9399

@@ -97,9 +103,12 @@ public function testCallCommandWithAppAsExecutable(): void
97103
$target = 'call-command-with-app-as-executable';
98104
$tester->executeTarget($target);
99105

106+
$expectedApp = $tester->getProject()->getProperty($target . '.test.app');
107+
Type::checkType($expectedApp, 'string');
108+
100109
$tester->assertLogMessageRegExp(sprintf(
101110
'~executing.+%s.+hello:world~i',
102-
$tester->getProject()->getProperty($target . '.test.app')
111+
$expectedApp
103112
), $target, Project::MSG_VERBOSE);
104113
}
105114

0 commit comments

Comments
 (0)