Code Duplication    Length = 14-15 lines in 3 locations

test/unit/test/ClientFactoryTest.php 2 locations

@@ 63-76 (lines=14) @@
60
    /**
61
     * @expectedException \AmericanExpress\HyperledgerFabricClient\Exception\InvalidArgumentException
62
     */
63
    public function testThrowsExceptionOnInvalidOrganization()
64
    {
65
        $config = new ClientConfig([
66
            'organizations' => [
67
                [
68
                    'name' => 'peerOrg1',
69
                    'mspId' => 'FooBar',
70
                    'adminCerts' => __FILE__,
71
                ],
72
            ],
73
        ]);
74
75
        ClientFactory::fromConfig($config, 'INVALID-ORG');
76
    }
77
78
    /**
79
     * @expectedException \AmericanExpress\HyperledgerFabricClient\Exception\InvalidArgumentException
@@ 81-95 (lines=15) @@
78
    /**
79
     * @expectedException \AmericanExpress\HyperledgerFabricClient\Exception\InvalidArgumentException
80
     */
81
    public function testThrowsExceptionOnInvalidNonce()
82
    {
83
        $config = new ClientConfig([
84
            'organizations' => [
85
                [
86
                    'name' => 'peerOrg1',
87
                    'mspId' => 'FooBar',
88
                    'adminCerts' => __FILE__,
89
                ],
90
            ],
91
            'nonce-size' => -5
92
        ]);
93
94
        ClientFactory::fromConfig($config);
95
    }
96
}
97

test/unit/test/User/UserContextFactoryTest.php 1 location

@@ 109-122 (lines=14) @@
106
    /**
107
     * @expectedException \AmericanExpress\HyperledgerFabricClient\Exception\UnexpectedValueException
108
     */
109
    public function testFromConfigWithInvalidOrganization()
110
    {
111
        $config = new ClientConfig([
112
            'organizations' => [
113
                [
114
                    'name' => 'peerOrg1',
115
                    'mspid' => 'Org1MSP',
116
                    'adminCerts' => __FILE__,
117
                ],
118
            ],
119
        ]);
120
121
        UserContextFactory::fromConfig($config, 'FooBar');
122
    }
123
}
124