Code Duplication    Length = 46-48 lines in 5 locations

tests/Unit/Entity/CategoryTraits/GameModeTest.php 1 location

@@ 20-65 (lines=46) @@
17
 * Class GameModeTest
18
 * @package Tfboe\FmLib\Tests\Unit\Entity\CategoryTraits
19
 */
20
class GameModeTest extends UnitTestCase
21
{
22
//<editor-fold desc="Public Methods">
23
  /**
24
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\GameMode::getGameMode
25
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\GameMode::setGameMode
26
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
27
   */
28
  public function testProperty()
29
  {
30
    $mock = $this->mock();
31
    self::assertNull($mock->getGameMode());
32
    /** @noinspection PhpUnhandledExceptionInspection */
33
    $mock->setGameMode(GameMode::SPEEDBALL);
34
    self::assertEquals(GameMode::SPEEDBALL, $mock->getGameMode());
35
    /** @noinspection PhpUnhandledExceptionInspection */
36
    $mock->setGameMode(null);
37
    self::assertNull($mock->getGameMode());
38
  }
39
40
  /**
41
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\GameMode::setGameMode
42
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
43
   * @uses   \Tfboe\FmLib\Exceptions\ValueNotValid::__construct
44
   */
45
  public function testPropertyException()
46
  {
47
    $mock = $this->mock();
48
    $this->expectException(ValueNotValid::class);
49
    $this->expectExceptionMessage(
50
      'The following value is not valid: 100 in Tfboe\FmLib\Entity\Categories\GameMode. Possible values: 0, 1, 2.');
51
    /** @noinspection PhpUnhandledExceptionInspection */
52
    $mock->setGameMode(100);
53
  }
54
//</editor-fold desc="Public Methods">
55
56
//<editor-fold desc="Private Methods">
57
  /**
58
   * @return \PHPUnit_Framework_MockObject_MockObject|\Tfboe\FmLib\Entity\CategoryTraits\GameMode
59
   */
60
  private function mock(): \PHPUnit_Framework_MockObject_MockObject
61
  {
62
    return $this->getMockForTrait(\Tfboe\FmLib\Entity\CategoryTraits\GameMode::class);
63
  }
64
//</editor-fold desc="Private Methods">
65
}

tests/Unit/Entity/CategoryTraits/OrganizingModeTest.php 1 location

@@ 20-65 (lines=46) @@
17
 * Class OrganizingModeTest
18
 * @package Tfboe\FmLib\Tests\Unit\Entity\CategoryTraits
19
 */
20
class OrganizingModeTest extends UnitTestCase
21
{
22
//<editor-fold desc="Public Methods">
23
  /**
24
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\OrganizingMode::getOrganizingMode
25
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\OrganizingMode::setOrganizingMode
26
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
27
   */
28
  public function testProperty()
29
  {
30
    $mock = $this->mock();
31
    self::assertNull($mock->getOrganizingMode());
32
    /** @noinspection PhpUnhandledExceptionInspection */
33
    $mock->setOrganizingMode(OrganizingMode::ELIMINATION);
34
    self::assertEquals(OrganizingMode::ELIMINATION, $mock->getOrganizingMode());
35
    /** @noinspection PhpUnhandledExceptionInspection */
36
    $mock->setOrganizingMode(null);
37
    self::assertNull($mock->getOrganizingMode());
38
  }
39
40
  /**
41
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\OrganizingMode::setOrganizingMode
42
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
43
   * @uses   \Tfboe\FmLib\Exceptions\ValueNotValid::__construct
44
   */
45
  public function testPropertyException()
46
  {
47
    $mock = $this->mock();
48
    $this->expectException(ValueNotValid::class);
49
    $this->expectExceptionMessage(
50
      'The following value is not valid: 100 in Tfboe\FmLib\Entity\Categories\OrganizingMode. Possible values: 0, 1.');
51
    /** @noinspection PhpUnhandledExceptionInspection */
52
    $mock->setOrganizingMode(100);
53
  }
54
//</editor-fold desc="Public Methods">
55
56
//<editor-fold desc="Private Methods">
57
  /**
58
   * @return \PHPUnit_Framework_MockObject_MockObject|\Tfboe\FmLib\Entity\CategoryTraits\OrganizingMode
59
   */
60
  private function mock(): \PHPUnit_Framework_MockObject_MockObject
61
  {
62
    return $this->getMockForTrait(\Tfboe\FmLib\Entity\CategoryTraits\OrganizingMode::class);
63
  }
64
//</editor-fold desc="Private Methods">
65
}

tests/Unit/Entity/CategoryTraits/ScoreModeTest.php 1 location

@@ 20-65 (lines=46) @@
17
 * Class ScoreModeTest
18
 * @package Tfboe\FmLib\Tests\Unit\Entity\CategoryTraits
19
 */
20
class ScoreModeTest extends UnitTestCase
21
{
22
//<editor-fold desc="Public Methods">
23
  /**
24
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\ScoreMode::getScoreMode
25
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\ScoreMode::setScoreMode
26
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
27
   */
28
  public function testProperty()
29
  {
30
    $mock = $this->mock();
31
    self::assertNull($mock->getScoreMode());
32
    /** @noinspection PhpUnhandledExceptionInspection */
33
    $mock->setScoreMode(ScoreMode::BEST_OF_FIVE);
34
    self::assertEquals(ScoreMode::BEST_OF_FIVE, $mock->getScoreMode());
35
    /** @noinspection PhpUnhandledExceptionInspection */
36
    $mock->setScoreMode(null);
37
    self::assertNull($mock->getScoreMode());
38
  }
39
40
  /**
41
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\ScoreMode::setScoreMode
42
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
43
   * @uses   \Tfboe\FmLib\Exceptions\ValueNotValid::__construct
44
   */
45
  public function testPropertyException()
46
  {
47
    $mock = $this->mock();
48
    $this->expectException(ValueNotValid::class);
49
    $this->expectExceptionMessage(
50
      'The following value is not valid: 100 in Tfboe\FmLib\Entity\Categories\ScoreMode. Possible values: 0, 1, 2.');
51
    /** @noinspection PhpUnhandledExceptionInspection */
52
    $mock->setScoreMode(100);
53
  }
54
//</editor-fold desc="Public Methods">
55
56
//<editor-fold desc="Private Methods">
57
  /**
58
   * @return \PHPUnit_Framework_MockObject_MockObject|\Tfboe\FmLib\Entity\CategoryTraits\ScoreMode
59
   */
60
  private function mock(): \PHPUnit_Framework_MockObject_MockObject
61
  {
62
    return $this->getMockForTrait(\Tfboe\FmLib\Entity\CategoryTraits\ScoreMode::class);
63
  }
64
//</editor-fold desc="Private Methods">
65
}

tests/Unit/Entity/CategoryTraits/TableTest.php 1 location

@@ 20-67 (lines=48) @@
17
 * Class TableTest
18
 * @package Tfboe\FmLib\Tests\Unit\Entity\CategoryTraits
19
 */
20
class TableTest extends UnitTestCase
21
{
22
//<editor-fold desc="Public Methods">
23
24
  /**
25
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\Table::getTable
26
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\Table::setTable
27
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
28
   */
29
  public function testProperty()
30
  {
31
    $mock = $this->mock();
32
    self::assertNull($mock->getTable());
33
    /** @noinspection PhpUnhandledExceptionInspection */
34
    $mock->setTable(Table::ROBERTO_SPORT);
35
    self::assertEquals(Table::ROBERTO_SPORT, $mock->getTable());
36
    /** @noinspection PhpUnhandledExceptionInspection */
37
    $mock->setTable(null);
38
    self::assertNull($mock->getTable());
39
  }
40
41
  /**
42
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\Table::setTable
43
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
44
   * @uses   \Tfboe\FmLib\Exceptions\ValueNotValid::__construct
45
   */
46
  public function testPropertyException()
47
  {
48
    $mock = $this->mock();
49
    $this->expectException(ValueNotValid::class);
50
    $this->expectExceptionMessage(
51
      'The following value is not valid: 100 in Tfboe\FmLib\Entity\Categories\Table. ' .
52
      'Possible values: 0, 1, 2, 3, 4, 5.');
53
    /** @noinspection PhpUnhandledExceptionInspection */
54
    $mock->setTable(100);
55
  }
56
//</editor-fold desc="Public Methods">
57
58
//<editor-fold desc="Private Methods">
59
  /**
60
   * @return \PHPUnit_Framework_MockObject_MockObject|\Tfboe\FmLib\Entity\CategoryTraits\Table
61
   */
62
  private function mock(): \PHPUnit_Framework_MockObject_MockObject
63
  {
64
    return $this->getMockForTrait(\Tfboe\FmLib\Entity\CategoryTraits\Table::class);
65
  }
66
//</editor-fold desc="Private Methods">
67
}

tests/Unit/Entity/CategoryTraits/TeamModeTest.php 1 location

@@ 20-66 (lines=47) @@
17
 * Class TeamModeTest
18
 * @package Tfboe\FmLib\Tests\Unit\Entity\CategoryTraits
19
 */
20
class TeamModeTest extends UnitTestCase
21
{
22
//<editor-fold desc="Public Methods">
23
24
  /**
25
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\TeamMode::getTeamMode
26
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\TeamMode::setTeamMode
27
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
28
   */
29
  public function testProperty()
30
  {
31
    $mock = $this->mock();
32
    self::assertNull($mock->getTeamMode());
33
    /** @noinspection PhpUnhandledExceptionInspection */
34
    $mock->setTeamMode(TeamMode::DOUBLE);
35
    self::assertEquals(TeamMode::DOUBLE, $mock->getTeamMode());
36
    /** @noinspection PhpUnhandledExceptionInspection */
37
    $mock->setTeamMode(null);
38
    self::assertNull($mock->getTeamMode());
39
  }
40
41
  /**
42
   * @covers \Tfboe\FmLib\Entity\CategoryTraits\TeamMode::setTeamMode
43
   * @uses   \Tfboe\FmLib\Helpers\BasicEnum
44
   * @uses   \Tfboe\FmLib\Exceptions\ValueNotValid::__construct
45
   */
46
  public function testPropertyException()
47
  {
48
    $mock = $this->mock();
49
    $this->expectException(ValueNotValid::class);
50
    $this->expectExceptionMessage(
51
      'The following value is not valid: 100 in Tfboe\FmLib\Entity\Categories\TeamMode. Possible values: 0, 1, 2.');
52
    /** @noinspection PhpUnhandledExceptionInspection */
53
    $mock->setTeamMode(100);
54
  }
55
//</editor-fold desc="Public Methods">
56
57
//<editor-fold desc="Private Methods">
58
  /**
59
   * @return \PHPUnit_Framework_MockObject_MockObject|\Tfboe\FmLib\Entity\CategoryTraits\TeamMode
60
   */
61
  private function mock(): \PHPUnit_Framework_MockObject_MockObject
62
  {
63
    return $this->getMockForTrait(\Tfboe\FmLib\Entity\CategoryTraits\TeamMode::class);
64
  }
65
//</editor-fold desc="Private Methods">
66
}