Skip to content

Commit

Permalink
[core] Cleanup some tests. (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 committed Apr 24, 2021
1 parent 1152fcf commit a2dce01
Show file tree
Hide file tree
Showing 233 changed files with 1,236 additions and 1,231 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -68,7 +68,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo_sqlite,pdo_mysql
extensions: pdo_sqlite,pdo_mysql,sockets,xsl

- uses: ramsey/composer-install@v1
with:
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Expand Up @@ -81,8 +81,13 @@
"require-dev": {
"ext-curl": "*",
"ext-iconv": "*",
"ext-openssl": "*",
"ext-pdo_sqlite": "*",
"ext-phar": "*",
"ext-simplexml": "*",
"ext-sockets": "*",
"ext-xsl": "*",
"ext-zip": "*",
"roave/security-advisories": "dev-master",
"aws/aws-sdk-php": "^3.112",
"friendsofphp/php-cs-fixer": "^2.18",
Expand Down
221 changes: 146 additions & 75 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion custom.task.properties
Expand Up @@ -87,7 +87,6 @@ ssh=Phing\Task\Ext\SshTask
scp=Phing\Task\Ext\ScpTask
phpunit=Phing\Task\Ext\PHPUnitTask
phpunitreport=Phing\Task\Ext\PHPUnitReportTask
visualizer=Phing\Task\Ext\VisualizerTask
svnlastrevision=Phing\Tasks\Ext\SvnLastRevisionTask
svncheckout=Phing\Tasks\Ext\SvnCheckoutTask
svnexport=Phing\Tasks\Ext\SvnExportTask
Expand All @@ -102,3 +101,4 @@ svnproplist=Phing\Tasks\Ext\SvnProplistTask
svnpropget=Phing\Tasks\Ext\SvnPropgetTask
svnpropset=Phing\Tasks\Ext\SvnPropsetTask
svnrevert=Phing\Tasks\Ext\SvnRevertTask
visualizer=Phing\Task\Ext\VisualizerTask
20 changes: 10 additions & 10 deletions tests/Phing/ExtensionPointTest.php
Expand Up @@ -39,17 +39,17 @@ public function setUp(): void
);
}

public function testExtensionPointWorksLikeTarget()
public function testExtensionPointWorksLikeTarget(): void
{
$this->expectLogContaining(__FUNCTION__, 'foobar');
}

public function testAddToExtensionPoint()
public function testAddToExtensionPoint(): void
{
$this->expectLogContaining(__FUNCTION__, 'In target bar');
}

public function testExtensionPointMustBeEmpty()
public function testExtensionPointMustBeEmpty(): void
{
$this->expectNotToPerformAssertions();

Expand All @@ -60,39 +60,39 @@ public function testExtensionPointMustBeEmpty()
}
}

public function testCantAddToPlainTarget()
public function testCantAddToPlainTarget(): void
{
$this->expectBuildException(__FUNCTION__, 'referenced target foo is not an extension-point');
}

public function testExtensionPointInImportedBuildfile()
public function testExtensionPointInImportedBuildfile(): void
{
$this->expectLogContaining(__FUNCTION__, 'in target prepare');
}

public function testExtensionPointInImportedBuildfileWithNestedImport()
public function testExtensionPointInImportedBuildfileWithNestedImport(): void
{
$this->expectLogContaining(__FUNCTION__, 'in compile java');
}

public function testMissingExtensionPointCausesError()
public function testMissingExtensionPointCausesError(): void
{
$this->expectBuildException(__FUNCTION__, 'can\'t add target bar to extension-point foo because the extension-point is unknown');
}

public function testMissingExtensionPointCausesWarningWhenConfigured()
public function testMissingExtensionPointCausesWarningWhenConfigured(): void
{
$this->executeTarget(__FUNCTION__);
$this->assertInLogs('can\'t add target bar to extension-point foo because the extension-point is unknown', Project::MSG_WARN);
}

public function testMissingExtensionPointIgnoredWhenConfigured()
public function testMissingExtensionPointIgnoredWhenConfigured(): void
{
$this->executeTarget(__FUNCTION__);
$this->assertNotInLogs('can\'t add target bar to extension-point foo because the extension-point is unknown', Project::MSG_WARN);
}

public function testOnlyAllowsExtensionPointMissingAttributeWhenExtensionOfPresent()
public function testOnlyAllowsExtensionPointMissingAttributeWhenExtensionOfPresent(): void
{
$this->expectBuildException(__FUNCTION__, 'onMissingExtensionPoint attribute cannot be specified unless extensionOf is specified');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/ClassConstantsTest.php
Expand Up @@ -38,7 +38,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testClassConstants()
public function testClassConstants(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/ConcatFilterTest.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testConcatFilter()
public function testConcatFilter(): void
{
$this->executeTarget('testConcatFilter');

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/EscapeUnicodeTest.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testEscapeUnicode()
public function testEscapeUnicode(): void
{
$this->executeTarget('testEscapeUnicode');

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/ExpandPropertiesTest.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testExpandProperties()
public function testExpandProperties(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/HeadFilterTest.php
Expand Up @@ -37,7 +37,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testHeadFilter()
public function testHeadFilter(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
6 changes: 3 additions & 3 deletions tests/Phing/Filter/LineContainsRegexpTest.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testLineContainsRegexp()
public function testLineContainsRegexp(): void
{
$this->executeTarget(__FUNCTION__);

Expand All @@ -50,7 +50,7 @@ public function testLineContainsRegexp()
$this->assertTrue($this->fu->contentEquals($expected, $result), "Files don't match!");
}

public function testLineContainsRegexpNegate()
public function testLineContainsRegexpNegate(): void
{
$this->executeTarget(__FUNCTION__);

Expand All @@ -59,7 +59,7 @@ public function testLineContainsRegexpNegate()
$this->assertTrue($this->fu->contentEquals($expected, $result), "Files don't match!");
}

public function testLineContainsRegexpCaseInsensitive()
public function testLineContainsRegexpCaseInsensitive(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
6 changes: 3 additions & 3 deletions tests/Phing/Filter/LineContainsTest.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testLineContains()
public function testLineContains(): void
{
$this->executeTarget('testLineContains');

Expand All @@ -50,7 +50,7 @@ public function testLineContains()
$this->assertTrue($this->fu->contentEquals($expected, $result), "Files don't match!");
}

public function testLineContainsNegate()
public function testLineContainsNegate(): void
{
$this->executeTarget(__FUNCTION__);

Expand All @@ -59,7 +59,7 @@ public function testLineContainsNegate()
$this->assertTrue($this->fu->contentEquals($expected, $result), "Files don't match!");
}

public function testLineContainsMatchAny()
public function testLineContainsMatchAny(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/PrefixLinesTest.php
Expand Up @@ -37,7 +37,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testPrefixLines()
public function testPrefixLines(): void
{
$this->executeTarget('testPrefixLines');

Expand Down
4 changes: 2 additions & 2 deletions tests/Phing/Filter/ReplaceTokensWithFileTest.php
Expand Up @@ -35,7 +35,7 @@ public function setUp(): void
/**
* Inspired by ticket #798 - http://www.phing.info/trac/ticket/798.
*/
public function testPostfix()
public function testPostfix(): void
{
$this->executeTarget(__FUNCTION__);

Expand All @@ -47,7 +47,7 @@ public function testPostfix()
/**
* Inspired by ticket #1046 - http://www.phing.info/trac/ticket/1046.
*/
public function testSlashInToken()
public function testSlashInToken(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/SortFilterTest.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testSortFilter()
public function testSortFilter(): void
{
$this->executeTarget('testSortFilter');

Expand Down
3 changes: 1 addition & 2 deletions tests/Phing/Filter/StripPhpCommentsTest.php
Expand Up @@ -47,10 +47,9 @@ public function tearDown(): void

/**
* @throws IOException
* @requires PHP 7
* @requires OSFAMILY Windows|Linux
*/
public function testStripPhpComments()
public function testStripPhpComments(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/StripWhitespaceTest.php
Expand Up @@ -37,7 +37,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testStripWhitespace()
public function testStripWhitespace(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Filter/SuffixLinesTest.php
Expand Up @@ -42,7 +42,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testSuffixLines()
public function testSuffixLines(): void
{
$this->executeTarget('testSuffixLines');

Expand Down
4 changes: 2 additions & 2 deletions tests/Phing/Filter/TailFilterTest.php
Expand Up @@ -37,7 +37,7 @@ public function tearDown(): void
$this->executeTarget('cleanup');
}

public function testTailFilter()
public function testTailFilter(): void
{
$this->executeTarget(__FUNCTION__);

Expand All @@ -47,7 +47,7 @@ public function testTailFilter()
$this->assertFileEquals($expected->getAbsolutePath(), $result->getAbsolutePath());
}

public function testTailHeadFilter()
public function testTailHeadFilter(): void
{
$this->executeTarget(__FUNCTION__);

Expand Down
6 changes: 3 additions & 3 deletions tests/Phing/Input/ConsoleInputHandlerTest.php
Expand Up @@ -29,7 +29,7 @@

class ConsoleInputHandlerTest extends TestCase
{
public function testDefaultValue()
public function testDefaultValue(): void
{
$inputStream = $this->createStream([' ']);
$output = new NullOutput();
Expand All @@ -42,7 +42,7 @@ public function testDefaultValue()
self::assertEquals('default', $request->getInput());
}

public function testMultipleChoiceQuestion()
public function testMultipleChoiceQuestion(): void
{
$inputStream = $this->createStream(['choice1']);
$output = new NullOutput();
Expand All @@ -54,7 +54,7 @@ public function testMultipleChoiceQuestion()
self::assertEquals('choice1', $request->getInput());
}

public function testYesNoQuestion()
public function testYesNoQuestion(): void
{
$inputStream = $this->createStream(['no']);
$output = new NullOutput();
Expand Down
6 changes: 3 additions & 3 deletions tests/Phing/Input/NoInteractionInputHandlerTest.php
Expand Up @@ -30,7 +30,7 @@

class NoInteractionInputHandlerTest extends TestCase
{
public function testDefaultValue()
public function testDefaultValue(): void
{
$request = new InputRequest('Enter a value');
$request->setDefaultValue('default');
Expand All @@ -41,7 +41,7 @@ public function testDefaultValue()
self::assertEquals('default', $request->getInput());
}

public function testMultipleChoiceQuestion()
public function testMultipleChoiceQuestion(): void
{
$request = new MultipleChoiceInputRequest('Enter a choice', ['choice1', 'choice2']);
$handler = new NoInteractionInputHandler();
Expand All @@ -51,7 +51,7 @@ public function testMultipleChoiceQuestion()
self::assertNull($request->getInput());
}

public function testYesNoQuestion()
public function testYesNoQuestion(): void
{
$request = new YesNoInputRequest('Enter a choice', ['yes', 'no']);
$handler = new NoInteractionInputHandler();
Expand Down
6 changes: 3 additions & 3 deletions tests/Phing/IntrospectionHelperTest.php
Expand Up @@ -51,7 +51,7 @@ public function setUp(): void
/**
* @throws BuildException
*/
public function testAddText()
public function testAddText(): void
{
$ih = IntrospectionHelper::getHelper(Exception::class);

Expand All @@ -68,15 +68,15 @@ public function testAddText()
$this->assertSame('test', $element->text);
}

public function testSupportsCharactersAdders()
public function testSupportsCharactersAdders(): void
{
$ih = IntrospectionHelper::getHelper(Exception::class);
$this->assertFalse($ih->supportsCharacters(), "String doesn\\'t support addText");
$ih = IntrospectionHelper::getHelper(IHProjectComponent::class);
$this->assertTrue($ih->supportsCharacters(), 'IHProjectComponent supports addText');
}

public function testElementCreators()
public function testElementCreators(): void
{
try {
IntrospectionHelper::getHelper(IHCreatorFail1::class);
Expand Down

0 comments on commit a2dce01

Please sign in to comment.