Skip to content

Commit

Permalink
Adjusted tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vassyli committed Feb 3, 2021
1 parent 104eff3 commit ace7685
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"name": "lotgd/module-gender",
"description": "Prompts the user with a selection for a gender at a new day.",
"type": "lotgd-module",
"license": "AGPL-3.0",
"version": "v0.6.0",
"license": "AGPL-3.0-or-later",
"authors": [
{
"name": "Basilius Sauter",
Expand All @@ -25,9 +24,9 @@
"prefer-stable" : true,

"require": {
"lotgd/core": "*",
"lotgd/module-village": "*",
"lotgd/module-new-day": "*"
"lotgd/core": "^0.6.0",
"lotgd/module-village": "^0.6",
"lotgd/module-new-day": "^0.6"
},

"require-dev": {
Expand Down
15 changes: 6 additions & 9 deletions tests/ModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
declare(strict_types=1);

use LotGD\Core\Configuration;
use LotGD\Core\Events\EventContext;
use LotGD\Core\GameBuilder;
use LotGD\Core\Game;
use LotGD\Core\Models\Character;
Expand Down Expand Up @@ -56,9 +57,6 @@ public function tearDown(): void
parent::tearDown();
}

/**
* @doesNotPerformAssertions
*/
public function testUnregister()
{
Module::onUnregister($this->g, $this->moduleModel);
Expand All @@ -72,25 +70,24 @@ public function testUnregister()
'characters', 'scenes', 'modules', 'scene_connections', "module_properties"
];

$this->assertDataWasKeptIntact($tableList);
$this->assertDataWasKeptIntact($this->getDataSet(), $this->getConnection()[0], $tableList);

// Since tearDown() contains an onUnregister() call, this also tests
// double-unregistering, which should be properly supported by modules.
}

/**
* @doesNotPerformAssertions
*/
public function testHandleUnknownEvent()
{
// Always good to test a non-existing event just to make sure nothing happens :).
$context = new \LotGD\Core\Events\EventContext(
$context = new EventContext(
"e/lotgd/tests/unknown-event",
"none",
\LotGD\Core\Events\EventContextData::create([])
);

Module::handleEvent($this->g, $context);
$newContext = Module::handleEvent($this->g, $context);

$this->assertSame($context, $newContext);
}

public function testModuleFlow()
Expand Down

0 comments on commit ace7685

Please sign in to comment.