Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Bump phpunit/phpunit from 7.5.18 to 8.5.1 #259

Merged
merged 2 commits into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: resolving broken tests and removing the psalm phpunit plugin
  • Loading branch information
erunion committed Jan 4, 2020
commit b08ae8358e8d6db642b76d0e0409bd3edf2577a6
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs/_site
node_modules/
reports/
vendor/
.phpunit.result.cache
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"require-dev": {
"league/flysystem-memory": "^1.0",
"phpunit/phpunit": "^8.5",
"psalm/plugin-phpunit": "^0.5",
"squizlabs/php_codesniffer": "^3.0",
"vimeo/psalm": "^3.0"
},
Expand Down
59 changes: 1 addition & 58 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0"?>
<psalm useDocblockTypes="true">
<plugins>
<pluginClass xmlns="https://getpsalm.org/schema/config" class="Psalm\PhpUnitPlugin\Plugin" />
</plugins>

<projectFiles>
<directory name="src" />
<directory name="tests/" />
Expand Down
7 changes: 3 additions & 4 deletions tests/Command/ChangelogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ public function testCommand(bool $private_objects, array $vendor_tags, string $e
);
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The supplied Mill configuration file does not exist.
*/
public function testCommandFailsOnInvalidConfigFile(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The supplied Mill configuration file does not exist.');

$this->tester->execute([
'command' => $this->command->getName(),
'output' => sys_get_temp_dir()
Expand Down
63 changes: 31 additions & 32 deletions tests/Command/CompileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testCommandForOpenApi(): void
$output = $this->tester->getDisplay();

foreach (self::VERSIONS as $version) {
$this->assertContains('API version: ' . $version, $output);
$this->assertStringContainsString('API version: ' . $version, $output);
}

$this->assertSame(array_merge(['.', '..'], self::VERSIONS), scandir($output_dir));
Expand Down Expand Up @@ -99,16 +99,16 @@ public function testCommandForOpenApiOnSpecificEnvironment(): void

$output = $this->tester->getDisplay();

$this->assertContains('`prod` environment', $output);
$this->assertStringContainsString('`prod` environment', $output);

foreach (self::VERSIONS as $version) {
$output = file_get_contents($output_dir . '/' . $version . '/openapi/api.json');

$this->assertContains('"url": "https:\/\/api.example.com"', $output);
$this->assertContains('Production', $output);
$this->assertStringContainsString('"url": "https:\/\/api.example.com"', $output);
$this->assertStringContainsString('Production', $output);

$this->assertNotContains('"url": "https:\/\/api.example.local"', $output);
$this->assertNotContains('Development', $output);
$this->assertStringNotContainsString('"url": "https:\/\/api.example.local"', $output);
$this->assertStringNotContainsString('Development', $output);
}
}

Expand All @@ -127,7 +127,7 @@ public function testCommandForOpenApiWithPublicOnlyDocs(): void
$output = $this->tester->getDisplay();

foreach (self::VERSIONS as $version) {
$this->assertContains('API version: ' . $version, $output);
$this->assertStringContainsString('API version: ' . $version, $output);

$json = file_get_contents($output_dir . '/' . $version . '/openapi/api.json');
$spec = json_decode($json, true);
Expand Down Expand Up @@ -156,7 +156,7 @@ public function testCommandForOpenApiForPublicConsumption(): void
$output = $this->tester->getDisplay();

foreach (self::VERSIONS as $version) {
$this->assertContains('API version: ' . $version, $output);
$this->assertStringContainsString('API version: ' . $version, $output);

// Grouped specifications should not be present.
$this->assertDirectoryNotExists($output_dir . '/' . $version . '/openapi');
Expand All @@ -172,10 +172,10 @@ public function testCommandForOpenApiForPublicConsumption(): void
);

// Vendor extensions should not be present anywhere within the spec.
$this->assertNotContains('x-mill-path-aliased', $json);
$this->assertNotContains('x-mill-path-aliases', $json);
$this->assertNotContains('x-mill-vendor-tags', $json);
$this->assertNotContains('x-mill-visibility-private', $json);
$this->assertStringNotContainsString('x-mill-path-aliased', $json);
$this->assertStringNotContainsString('x-mill-path-aliases', $json);
$this->assertStringNotContainsString('x-mill-vendor-tags', $json);
$this->assertStringNotContainsString('x-mill-visibility-private', $json);
}
}

Expand All @@ -197,7 +197,7 @@ public function testCommandForOpenApiWithPublicOnlyDocsAndAVendorTag(): void
$output = $this->tester->getDisplay();

foreach (self::VERSIONS as $version) {
$this->assertContains('API version: ' . $version, $output);
$this->assertStringContainsString('API version: ' . $version, $output);

$json = file_get_contents($output_dir . '/' . $version . '/openapi/api.json');
$spec = json_decode($json, true);
Expand Down Expand Up @@ -238,7 +238,7 @@ public function testCommandForApiBlueprint(): void
$output = $this->tester->getDisplay();

foreach (self::VERSIONS as $version) {
$this->assertContains('API version: ' . $version, $output);
$this->assertStringContainsString('API version: ' . $version, $output);
}

$this->assertSame(array_merge(['.', '..'], self::VERSIONS), scandir($output_dir));
Expand Down Expand Up @@ -288,9 +288,9 @@ public function testCommandWithDefaultVersion(string $format, string $format_nam
]);

$output = $this->tester->getDisplay();
$this->assertContains($format_name, $output);
$this->assertNotContains('API version: 1.0', $output);
$this->assertContains('API version: 1.1', $output);
$this->assertStringContainsString($format_name, $output);
$this->assertStringNotContainsString('API version: 1.0', $output);
$this->assertStringContainsString('API version: 1.1', $output);
}

/**
Expand All @@ -309,9 +309,9 @@ public function testCommandWithLatestVersion(string $format, string $format_name
]);

$output = $this->tester->getDisplay();
$this->assertContains($format_name, $output);
$this->assertNotContains('API version: 1.1.2', $output);
$this->assertContains('API version: 1.1.3', $output);
$this->assertStringContainsString($format_name, $output);
$this->assertStringNotContainsString('API version: 1.1.2', $output);
$this->assertStringContainsString('API version: 1.1.3', $output);
}

/**
Expand All @@ -330,17 +330,16 @@ public function testCommandWithSpecificConstraint(string $format, string $format
]);

$output = $this->tester->getDisplay();
$this->assertContains($format_name, $output);
$this->assertContains('API version: 1.0', $output);
$this->assertNotContains('API version: 1.1', $output);
$this->assertStringContainsString($format_name, $output);
$this->assertStringContainsString('API version: 1.0', $output);
$this->assertStringNotContainsString('API version: 1.1', $output);
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The supplied Mill configuration file does not exist.
*/
public function testCommandFailsOnInvalidConfigFile(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The supplied Mill configuration file does not exist.');

$this->tester->execute([
'command' => $this->command->getName(),
'output' => sys_get_temp_dir()
Expand All @@ -357,8 +356,8 @@ public function testCommandFailsOnInvalidVersionConstraint(): void
]);

$output = $this->tester->getDisplay();
$this->assertContains('1.^', $output);
$this->assertContains('unrecognized schema', $output);
$this->assertStringContainsString('1.^', $output);
$this->assertStringContainsString('unrecognized schema', $output);
}

public function testCommandFailsOnInvalidFormat(): void
Expand All @@ -371,8 +370,8 @@ public function testCommandFailsOnInvalidFormat(): void
]);

$output = $this->tester->getDisplay();
$this->assertContains('raml', $output);
$this->assertContains('unknown compilation format', $output);
$this->assertStringContainsString('raml', $output);
$this->assertStringContainsString('unknown compilation format', $output);
}

public function testCommandFailsOnInvalidEnvironment(): void
Expand All @@ -386,7 +385,7 @@ public function testCommandFailsOnInvalidEnvironment(): void
]);

$output = $this->tester->getDisplay();
$this->assertContains('environment has not been configured', $output);
$this->assertStringContainsString('environment has not been configured', $output);
}

/**
Expand Down
21 changes: 10 additions & 11 deletions tests/Command/ErrorMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public function testCommand(bool $private_objects, array $vendor_tags, string $e

$output = $this->tester->getDisplay();

$this->assertNotContains('API version: 1.1.2', $output);
$this->assertStringNotContainsString('API version: 1.1.2', $output);
foreach ($versions as $version) {
$this->assertContains('API version: ' . $version, $output);
$this->assertStringContainsString('API version: ' . $version, $output);

$control_dir = __DIR__ . '/../../resources/examples/Showtimes/compiled/' . $version;
$this->assertFileEquals(
Expand All @@ -94,7 +94,7 @@ public function testCommandWithDefaultVersion(): void

// In our test cases, there's no error codes under the default API version, so this shouldn't be creating error
// maps.
$this->assertNotContains('API version', $output);
$this->assertStringNotContainsString('API version', $output);
}

public function testCommandWithSpecificConstraint(): void
Expand All @@ -107,16 +107,15 @@ public function testCommandWithSpecificConstraint(): void
]);

$output = $this->tester->getDisplay();
$this->assertContains('API version: 1.0', $output);
$this->assertNotContains('API version: 1.1', $output);
$this->assertStringContainsString('API version: 1.0', $output);
$this->assertStringNotContainsString('API version: 1.1', $output);
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The supplied Mill configuration file does not exist.
*/
public function testCommandFailsOnInvalidConfigFile(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The supplied Mill configuration file does not exist.');

$this->tester->execute([
'command' => $this->command->getName(),
'output' => sys_get_temp_dir()
Expand All @@ -133,8 +132,8 @@ public function testCommandFailsOnInvalidVersionConstraint(): void
]);

$output = $this->tester->getDisplay();
$this->assertContains('1.^', $output);
$this->assertContains('unrecognized schema', $output);
$this->assertStringContainsString('1.^', $output);
$this->assertStringContainsString('unrecognized schema', $output);
}

public function providerTestCommand(): array
Expand Down
Loading