Skip to content

Commit

Permalink
remove expectException() from delete entity unit/itegration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rico132 committed Jul 21, 2022
1 parent c440b87 commit 874f6cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 4 additions & 6 deletions tests/integration/HawkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,8 @@ public function testDeleteEntity(array $blockFiles, array $entitiesFiles): void
$hawk->save();

$hawk = new Hawk(blockFiles: $blockFiles, entitiesFiles: $entitiesFiles);
$this->expectException(Exception::class);
$this->expectExceptionMessage("Entity not found.");
$hawk->getEntities("minecraft:chicken", $this->getEntityCoords());
$entities = $hawk->getEntities("minecraft:chicken", $this->getEntityCoords());
$this->assertEmpty($entities);
}

/**
Expand All @@ -314,8 +313,7 @@ public function testDeleteNegativeEntity(array $blockFiles, array $entitiesFiles
$hawk->save();

$hawk = new Hawk(blockFiles: $blockFiles, entitiesFiles: $entitiesFiles);
$this->expectException(Exception::class);
$this->expectExceptionMessage("Entity not found.");
$hawk->getEntities("minecraft:chicken", $this->getNegativeEntityCoords());
$entities = $hawk->getEntities("minecraft:chicken", $this->getNegativeEntityCoords());
$this->assertEmpty($entities);
}
}
4 changes: 1 addition & 3 deletions tests/unit/HawkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,9 @@ public function testDeleteEntity(array $blockFiles, array $entitiesFiles): void
{
$hawk = new Hawk($blockFiles, $entitiesFiles);
$entities = $hawk->getEntities("minecraft:chicken", $this->getEntityCoords());
$count = count($entities);
$hawk->deleteEntity($entities[0]);

$this->expectException(Exception::class);
$this->expectExceptionMessage("Entity not found.");
$entities = $hawk->getEntities("minecraft:chicken", $this->getEntityCoords());
$this->assertEmpty($entities);
}
}

0 comments on commit 874f6cb

Please sign in to comment.