Skip to content

Commit

Permalink
rename unit to integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ShockedPlot7560 committed Nov 24, 2023
1 parent 628619a commit a7af995
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN php -dphar.readonly=0 build/server-phar.php --git $(git rev-parse HEAD)
RUN test -f /build/PocketMine-MP.phar

WORKDIR /build
COPY ../ /build/pmmpunit
COPY ./ /build/pmmpunit
WORKDIR /build/pmmpunit
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer install --no-dev --prefer-source --no-interaction --optimize-autoloader
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## PmUnitTest - Unit Testing Framework for PocketMine
## PmIntegration - Integration Testing Framework for PocketMine

**Run only on Unix (Linux, Mac)**

This plugin has been created with the sole aim of making unit, integration and functional tests possible during the pocketmine runtime.
This plugin has been created with the sole aim of making integration and functional tests possible during the pocketmine runtime.

It can be used to correctly test the expected result of a command executed by a fake player, interaction with events and multi-threading support.

Expand All @@ -27,7 +27,7 @@ docker run -it --rm \
```

> [!NOTE]
> An action to simplify the execution of unit tests in a github workflow should be available soon.
> An action to simplify the execution of integration tests in a github workflow should be available soon.
## Utilisation

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shockedplot7560/pmmp-unit",
"description": "Unit testing framework for PocketMine-MP",
"description": "Integration testing framework for PocketMine-MP",
"authors": [
{
"name": "ShockedPlot7560",
Expand Down
8 changes: 4 additions & 4 deletions src/PmmpUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public function __construct(PluginLoader $loader, Server $server, PluginDescript
protected function onLoad() : void {
$unitFolder = $this->getDataFolder() . "tests";
if (!is_dir($unitFolder)) {
$this->getLogger()->warning("Unit test folder ($unitFolder) not found, creating one...");
$this->getLogger()->warning("Tests folder ($unitFolder) not found, creating one...");
mkdir($unitFolder);
}

$testSuite = getenv("TEST_SUITE");
if ($testSuite !== false) {
$unitFolder .= "/" . $testSuite;
if (!is_dir($unitFolder)) {
$this->getLogger()->warning("Unit test folder ($unitFolder) not found, creating one...");
$this->getLogger()->warning("Tests folder ($unitFolder) not found, creating one...");
mkdir($unitFolder);
}
}
Expand Down Expand Up @@ -129,9 +129,9 @@ private function finish(bool $close = true) : void {
}
}

$this->getLogger()->notice("=== Unit Test Results ===");
$this->getLogger()->notice("=== Tests Results ===");
if (count($fatalErrors) > 0) {
$this->getLogger()->error("Fatal errors occurred during unit test:");
$this->getLogger()->error("Fatal errors occurred during tests:");
$i = 0;
foreach ($fatalErrors as $error) {
$this->getLogger()->error(++$i . ") " . $error->test->__toString() . ": " . str_replace("§", "&", $error->throwable->getMessage()) . " (line: " . $error->throwable->getLine() . ")");
Expand Down

0 comments on commit a7af995

Please sign in to comment.