• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlocati / nexi / 8554696988

04 Apr 2024 12:32PM UTC coverage: 4.556% (+1.6%) from 3.004%
8554696988

push

github

mlocati
Add test cards

28 of 36 new or added lines in 2 files covered. (77.78%)

79 of 1734 relevant lines covered (4.56%)

0.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/Dictionary/TestCard/Card.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace MLocati\Nexi\Dictionary\TestCard;
6

7
class Card
8
{
9
    /**
10
     * @var bool
11
     */
12
    private $positiveOutcome;
13

14
    /**
15
     * @var string
16
     */
17
    private $circuit;
18

19
    /**
20
     * @var string
21
     */
22
    private $formattedCardNumber;
23

24
    /**
25
     * @var int
26
     */
27
    private $expiryMonth;
28

29
    /**
30
     * @var int
31
     */
32
    private $expiryYear;
33

34
    /**
35
     * @var string
36
     */
37
    private $cvv;
38

39
    public function __construct(bool $positiveOutcome, string $circuit, string $formattedCardNumber, int $expiryMonth, int $expiryYear, string $cvv)
40
    {
41
        $this->positiveOutcome = $positiveOutcome;
1✔
42
        $this->circuit = $circuit;
1✔
43
        $this->formattedCardNumber = $formattedCardNumber;
1✔
44
        $this->expiryMonth = $expiryMonth;
1✔
45
        $this->expiryYear = $expiryYear;
1✔
46
        $this->cvv = $cvv;
1✔
47
    }
1✔
48

49
    public function isPositiveOutcome(): bool
50
    {
51
        return $this->positiveOutcome;
1✔
52
    }
53

54
    public function getCircuit(): string
55
    {
56
        return $this->circuit;
1✔
57
    }
58

59
    public function getCardNumber(): string
60
    {
61
        return strtr($this->getFormattedCardNumber(), [' ' => '', '-' => '']);
1✔
62
    }
63

64
    public function getFormattedCardNumber(): string
65
    {
66
        return $this->formattedCardNumber;
1✔
67
    }
68

69
    public function getExpiryMonth(): int
70
    {
71
        return $this->expiryMonth;
1✔
72
    }
73

74
    public function getExpiryYear(): int
75
    {
76
        return $this->expiryYear;
1✔
77
    }
78

79
    public function getExpiry(): string
80
    {
81
        return implode('/', [
1✔
82
            str_pad((string) $this->expiryMonth, 2, '0', STR_PAD_LEFT),
1✔
83
            str_pad((string) $this->expiryYear, $this->expiryYear >= 100 ? 4 : 2, '0', STR_PAD_LEFT),
1✔
84
        ]);
85
    }
86

87
    public function getCvv(): string
88
    {
NEW
89
        return $this->cvv;
×
90
    }
91

92
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc