ResponseCodesTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testMessageNotFound() 0 5 1
A testMessageFoundWithCodeAndStatus() 0 5 1
A testMessageFoundWithCodeOnly() 0 5 1
A testMessageFoundWithStatusOnly() 0 5 1
A testMessageFoundWithCodeAndNoStatus() 0 5 1
1
<?php
2
3
use CorreiosAPI\Tracker\ResponseCodes;
4
5
class ResponseCodesTest extends TestCase
6
{
7
  public function testMessageNotFound()
8
  {
9
    $message = ResponseCodes::getMessage('FOO', 100);
10
    $this->assertEquals('Desconhecido (FOO-100)', $message);
11
  }
12
13
  public function testMessageFoundWithCodeAndStatus()
14
  {
15
    $message = ResponseCodes::getMessage('FC', 3);
16
    $this->assertEquals('Mal encaminhado', $message);
17
  }
18
19
  public function testMessageFoundWithCodeOnly()
20
  {
21
    $message = ResponseCodes::getMessage('OEC', 1823712873812);
22
    $this->assertEquals('Saiu para entrega', $message);
23
  }
24
25
  public function testMessageFoundWithStatusOnly()
26
  {
27
    $message = ResponseCodes::getMessage('BRHUEHUEHUE', 50);
28
    $this->assertEquals('Roubo a carteiro', $message);
29
  }
30
31
  public function testMessageFoundWithCodeAndNoStatus()
32
  {
33
    $message = ResponseCodes::getMessage('LDI', null);
34
    $this->assertEquals('Aguardando retirada - Caixa postal - Fiscalização', $message);
35
  }
36
}
37