Code Duplication    Length = 9-10 lines in 4 locations

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

@@ 146-154 (lines=9) @@
143
   * @uses   \Tfboe\FmLib\Entity\Helpers\SubClassData::initSubClassData
144
   * @uses   \Tfboe\FmLib\Exceptions\MethodNotExistingException::__construct
145
   */
146
  public function testNotExistingMethodCall()
147
  {
148
    $entity = $this->mock();
149
    $entity->initSubClassData([]);
150
    $this->expectException(MethodNotExistingException::class);
151
    $this->expectExceptionMessage("An object of the class " . get_class($entity) . " had no method notExistingMethod");
152
    /** @noinspection PhpUndefinedMethodInspection */
153
    $entity->notExistingMethod();
154
  }
155
156
  /**
157
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::__call
@@ 161-169 (lines=9) @@
158
   * @uses   \Tfboe\FmLib\Entity\Helpers\SubClassData::initSubClassData
159
   * @uses   \Tfboe\FmLib\Exceptions\MethodNotExistingException::__construct
160
   */
161
  public function testNotExistingMethodSetterNoArgument()
162
  {
163
    $entity = $this->mock();
164
    $entity->initSubClassData([]);
165
    $this->expectException(MethodNotExistingException::class);
166
    $this->expectExceptionMessage("An object of the class " . get_class($entity) . " had no method setProp");
167
    /** @noinspection PhpUndefinedMethodInspection */
168
    $entity->setProp();
169
  }
170
171
  /**
172
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::__call
@@ 177-186 (lines=10) @@
174
   * @uses   \Tfboe\FmLib\Entity\Helpers\SubClassData::initSubClassData
175
   * @uses   \Tfboe\FmLib\Exceptions\PropertyNotExistingException::__construct
176
   */
177
  public function testNotExistingPropertyGetCall()
178
  {
179
    $entity = $this->mock();
180
    $entity->initSubClassData([]);
181
    $this->expectException(PropertyNotExistingException::class);
182
    $this->expectExceptionMessage("An object of the class " . get_class($entity) .
183
      " had no property prop via getProperty");
184
    /** @noinspection PhpUndefinedMethodInspection */
185
    $entity->getProp();
186
  }
187
188
  /**
189
   * @covers \Tfboe\FmLib\Entity\Helpers\SubClassData::__call
@@ 194-203 (lines=10) @@
191
   * @uses   \Tfboe\FmLib\Entity\Helpers\SubClassData::initSubClassData
192
   * @uses   \Tfboe\FmLib\Exceptions\PropertyNotExistingException::__construct
193
   */
194
  public function testNotExistingPropertySetCall()
195
  {
196
    $entity = $this->mock();
197
    $entity->initSubClassData([]);
198
    $this->expectException(PropertyNotExistingException::class);
199
    $this->expectExceptionMessage("An object of the class " . get_class($entity) .
200
      " had no property prop via setProperty");
201
    /** @noinspection PhpUndefinedMethodInspection */
202
    $entity->setProp(5);
203
  }
204
//</editor-fold desc="Public Methods">
205
206
//<editor-fold desc="Private Methods">