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

mlocati / nexi / 8554393244

04 Apr 2024 12:11PM UTC coverage: 4.097% (+1.1%) from 3.004%
8554393244

push

github

mlocati
Add test cards

20 of 35 new or added lines in 2 files covered. (57.14%)

71 of 1733 relevant lines covered (4.1%)

0.05 hits per line

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

50.0
/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 $cardNumber;
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 $cardNumber, int $expiryMonth, int $expiryYear, string $cvv)
40
    {
41
        $this->positiveOutcome = $positiveOutcome;
1✔
42
        $this->circuit = $circuit;
1✔
43
        $this->cardNumber = $cardNumber;
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
    {
NEW
56
        return $this->circuit;
×
57
    }
58

59
    public function getCardNumber(): string
60
    {
NEW
61
        return $this->cardNumber;
×
62
    }
63

64
    public function getExpiryMonth(): int
65
    {
NEW
66
        return $this->expiryMonth;
×
67
    }
68

69
    public function getExpiryYear(): int
70
    {
NEW
71
        return $this->expiryYear;
×
72
    }
73

74
    public function getExpiry(): string
75
    {
NEW
76
        return implode('/', [
×
NEW
77
            str_pad((string) $this->expiryMonth, 2, '0', STR_PAD_LEFT),
×
NEW
78
            str_pad((string) $this->expiryYear, $this->expiryYear >= 100 ? 4 : 2, '0', STR_PAD_LEFT),
×
79
        ]);
80
    }
81

82
    public function getCvv(): string
83
    {
NEW
84
        return $this->cvv;
×
85
    }
86

87
}
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

© 2025 Coveralls, Inc