MethodNotExistingExceptionTest::testConstructor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 6
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Created by PhpStorm.
5
 * User: benedikt
6
 * Date: 10/1/17
7
 * Time: 2:08 PM
8
 */
9
10
namespace Tfboe\FmLib\Tests\Unit\Exceptions;
11
12
13
use Tfboe\FmLib\Exceptions\MethodNotExistingException;
14
use Tfboe\FmLib\Tests\Helpers\UnitTestCase;
15
16
/**
17
 * Class AuthenticationExceptionTest
18
 * @package Tfboe\FmLib\Tests\Unit\Exceptions
19
 */
20 View Code Duplication
class MethodNotExistingExceptionTest extends UnitTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
//<editor-fold desc="Public Methods">
23
  /**
24
   * @covers \Tfboe\FmLib\Exceptions\MethodNotExistingException::__construct
25
   */
26
  public function testConstructor()
27
  {
28
    $exc = new MethodNotExistingException("class", "method");
29
    self::assertEquals($exc->getMessage(), "An object of the class class had no method method");
30
    self::assertEquals(0, $exc->getCode());
31
  }
32
33
  /**
34
   * @covers \Tfboe\FmLib\Exceptions\MethodNotExistingException::getJsonMessage
35
   * @uses   \Tfboe\FmLib\Exceptions\MethodNotExistingException::__construct
36
   */
37
  public function testJsonMessage()
38
  {
39
    $exc = new MethodNotExistingException("class", "method");
40
    self::assertEquals(['message' => 'Missing method in object', 'className' => 'class', 'methodName' => 'method'],
41
      $exc->getJsonMessage());
42
  }
43
//</editor-fold desc="Public Methods">
44
}