File: PaymentTest.php

package info (click to toggle)
php-faker 1.20.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,412 kB
  • sloc: php: 115,671; xml: 213; makefile: 49
file content (94 lines) | stat: -rw-r--r-- 2,296 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php

namespace Faker\Test\Provider\ne_NP;

use Faker\Provider\ne_NP\Payment;
use Faker\Test\TestCase;

final class PaymentTest extends TestCase
{
    public function testCommercialBank(): void
    {
        $str = $this->faker->commercialBank();
        self::assertIsString($str);

        $this->faker->seed(1);

        $strNext = $this->faker->commercialBank();
        self::assertSame($str, $strNext);
    }

    public function testDevelopmentBank(): void
    {
        $str = $this->faker->developmentBank();
        self::assertIsString($str);

        $this->faker->seed(1);

        $strNext = $this->faker->developmentBank();
        self::assertSame($str, $strNext);
    }

    public function testFinanceCompany(): void
    {
        $str = $this->faker->financeCompany();
        self::assertIsString($str);

        $this->faker->seed(1);

        $strNext = $this->faker->financeCompany();
        self::assertSame($str, $strNext);
    }

    public function testMicroFinance(): void
    {
        $str = $this->faker->microFinance();
        self::assertIsString($str);
        self::assertStringContainsString('Laghubitta', $str);

        $this->faker->seed(1);

        $strNext = $this->faker->microFinance();
        self::assertSame($str, $strNext);
    }

    public function testDigitalWallet(): void
    {
        $str = $this->faker->digitalWallet();
        self::assertIsString($str);

        $this->faker->seed(1);

        $strNext = $this->faker->digitalWallet();
        self::assertSame($str, $strNext);
    }

    public function testSwiftCode(): void
    {
        $str = $this->faker->swiftCode();
        self::assertIsString($str);

        $this->faker->seed(1);

        $strNext = $this->faker->swiftCode();
        self::assertSame($str, $strNext);
    }

    public function testBankAccountNumber(): void
    {
        $str = $this->faker->bankAccountNumber();
        self::assertIsString($str);
        self::assertGreaterThanOrEqual(9, strlen($str));
        self::assertLessThanOrEqual(20, strlen($str));

        $this->faker->seed(1);

        $strNext = $this->faker->bankAccountNumber();
        self::assertSame($str, $strNext);
    }

    protected function getProviders(): iterable
    {
        yield new Payment($this->faker);
    }
}