Code Duplication    Length = 17-27 lines in 2 locations

tests/Unit/Entity/Helpers/SubClassDataTest.php 2 locations

@@ 89-115 (lines=27) @@
86
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::initSubClassData
87
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::hasProperty
88
   */
89
  public function testInitSubClassDataAndHasProperty()
90
  {
91
    $entity = $this->mock();
92
    /** @noinspection SpellCheckingInspection */
93
    $entity->initSubClassData(["TESTUPPER", "testlower"]);
94
    /** @noinspection SpellCheckingInspection */
95
    self::assertTrue($entity->hasProperty("testupper"));
96
    /** @noinspection SpellCheckingInspection */
97
    self::assertTrue($entity->hasProperty("TESTUPPER"));
98
    /** @noinspection SpellCheckingInspection */
99
    self::assertTrue($entity->hasProperty("TESTupper"));
100
    /** @noinspection SpellCheckingInspection */
101
    self::assertTrue($entity->hasProperty("testlower"));
102
    /** @noinspection SpellCheckingInspection */
103
    self::assertTrue($entity->hasProperty("TESTLOWER"));
104
    /** @noinspection SpellCheckingInspection */
105
    self::assertTrue($entity->hasProperty("TESTlower"));
106
    /** @noinspection SpellCheckingInspection */
107
    self::assertFalse($entity->hasProperty("notexisting"));
108
    /** @noinspection SpellCheckingInspection */
109
    self::assertFalse($entity->hasProperty("NOTEXISTING"));
110
    /** @noinspection SpellCheckingInspection */
111
    self::assertFalse($entity->hasProperty("NOTexistING"));
112
    self::assertTrue($entity->hasProperty("subClassData"));
113
    /** @noinspection SpellCheckingInspection */
114
    self::assertFalse($entity->hasProperty("SUBCLASSDATA"));
115
  }
116
117
  /**
118
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::methodExists
@@ 123-139 (lines=17) @@
120
   * @uses   \Tfboe\FmLib\Entity\Helpers\SubClassData::hasProperty
121
   * @uses   \Tfboe\FmLib\Entity\Helpers\SubClassData::initSubClassData
122
   */
123
  public function testMethodExists()
124
  {
125
    $entity = $this->mock();
126
    $entity->initSubClassData(["test"]);
127
    self::assertTrue($entity->methodExists("methodExists"));
128
    self::assertFalse($entity->methodExists("notExistingMethod"));
129
    self::assertFalse($entity->methodExists("getProp"));
130
    self::assertFalse($entity->methodExists("isProp"));
131
    self::assertFalse($entity->methodExists("setProp"));
132
    self::assertTrue($entity->methodExists("getTest"));
133
    self::assertTrue($entity->methodExists("isTest"));
134
    self::assertTrue($entity->methodExists("setTest"));
135
    $entity->addPropertyIfNotExistent("prop", null);
136
    self::assertTrue($entity->methodExists("getProp"));
137
    self::assertTrue($entity->methodExists("isProp"));
138
    self::assertTrue($entity->methodExists("setProp"));
139
  }
140
141
  /**
142
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::__call