Skip to content

Commit

Permalink
Merge pull request #13 from iamyukihiro/fix-test
Browse files Browse the repository at this point in the history
test: Remove DTO test
  • Loading branch information
iamyukihiro authored Apr 29, 2024
2 parents b294866 + 48459ea commit 5f98e52
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 153 deletions.
2 changes: 1 addition & 1 deletion bin/dev/down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
cd bin/dev/ || exit
cd bin/dev/ &&
docker compose down -v
2 changes: 1 addition & 1 deletion src/Service/PsySH/AddMedakaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(
/**
* {@inheritDoc}
*/
protected function configure()
protected function configure(): void
{
$this
->setName('add-medaka')
Expand Down
2 changes: 1 addition & 1 deletion src/Service/PsySH/InitTankCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
/**
* {@inheritDoc}
*/
protected function configure()
protected function configure(): void
{
$this
->setName('init-tank')
Expand Down
2 changes: 1 addition & 1 deletion src/Service/PsySH/ViewTankCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
/**
* {@inheritDoc}
*/
protected function configure()
protected function configure(): void
{
$this
->setName('view-tank')
Expand Down
2 changes: 2 additions & 0 deletions tests/AquariumTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @noinspection NonAsciiCharacters */

declare(strict_types=1);

namespace Iamyukihiro\Aquarium;
Expand Down
31 changes: 0 additions & 31 deletions tests/Domain/Model/Fish/MedakaTest.php

This file was deleted.

53 changes: 0 additions & 53 deletions tests/Domain/Model/Tank/TankManager/LoadTankTest.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@

declare(strict_types=1);

namespace Iamyukihiro\Aquarium\Domain\Model\Tank\TankManager;
namespace Iamyukihiro\Aquarium\Domain\Model\Tank;

use Iamyukihiro\Aquarium\Domain\Exception\NotFileOpenException;
use Iamyukihiro\Aquarium\Domain\Model\Tank\Tank;
use Iamyukihiro\Aquarium\Domain\Model\Tank\TankManager;
use PHPUnit\Framework\TestCase;

class SaveTankTest extends TestCase
class TankManagerTest extends TestCase
{
private string $path;

protected function setUp(): void
private function setUpReadableTank(): void
{
$this->path = dirname(__FILE__) . '/../../.memory/tank_test.memory';

Expand All @@ -31,8 +29,10 @@ protected function setUp(): void
fclose($fileHandle);
}

public function test_(): void
public function test_save(): void
{
$this->setUpReadableTank();

$tank = new Tank();

$SUT = $this->getSUT($this->path);
Expand All @@ -47,8 +47,20 @@ public function test_(): void
);
}

public function test_load(): void
{
$this->setUpReadableTank();

$SUT = $this->getSUT($this->path);
$actual = $SUT->load();

$this->assertInstanceOf(Tank::class, $actual);
}

public function test_Tankファイルが開けない場合は例外を返すこと(): void
{
$this->setUpReadableTank();

$this->expectException(NotFileOpenException::class);
$tank = new Tank();

Expand Down
30 changes: 0 additions & 30 deletions tests/Domain/Model/Tank/TankTest.php

This file was deleted.

29 changes: 0 additions & 29 deletions tests/Domain/VO/VarietyTest.php

This file was deleted.

2 changes: 2 additions & 0 deletions tests/Service/PsySH/AddMedakaCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @noinspection NonAsciiCharacters */

declare(strict_types=1);

namespace Iamyukihiro\Aquarium\Service\PsySH;
Expand Down
2 changes: 2 additions & 0 deletions tests/Service/PsySH/ViewTankCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @noinspection NonAsciiCharacters */

declare(strict_types=1);

namespace Iamyukihiro\Aquarium\Service\PsySH;
Expand Down

0 comments on commit 5f98e52

Please sign in to comment.