@@ -37,7 +37,7 @@ public function testAddAccount(): void
37
37
public function testInvalidAlias (): void
38
38
{
39
39
$ account1 = new FioAccount ('323536 ' , 'foo ' );
40
- $ accounts = new AccountCollection ;
40
+ $ accounts = new AccountCollection () ;
41
41
$ accounts ->addAccount ('foo ' , $ account1 );
42
42
$ accounts ->account ('bar ' );
43
43
}
@@ -47,7 +47,7 @@ public function testCount(): void
47
47
{
48
48
$ account1 = new FioAccount ('323536 ' , 'foo ' );
49
49
$ account2 = new FioAccount ('978654 ' , 'bar ' );
50
- $ accounts = new AccountCollection ;
50
+ $ accounts = new AccountCollection () ;
51
51
Assert::equal (0 , $ accounts ->count ());
52
52
53
53
$ accounts ->addAccount ('foo ' , $ account1 );
@@ -60,7 +60,7 @@ public function testIteration(): void
60
60
{
61
61
$ account1 = new FioAccount ('323536 ' , 'foo ' );
62
62
$ account2 = new FioAccount ('978654 ' , 'bar ' );
63
- $ accounts = new AccountCollection ;
63
+ $ accounts = new AccountCollection () ;
64
64
$ accounts ->addAccount ('foo ' , $ account1 );
65
65
$ accounts ->addAccount ('bar ' , $ account2 );
66
66
@@ -76,7 +76,7 @@ public function testIteration(): void
76
76
*/
77
77
public function testEmpty (): void
78
78
{
79
- (new AccountCollection )->account ();
79
+ (new AccountCollection () )->account ();
80
80
}
81
81
82
82
@@ -87,7 +87,7 @@ public function testDuplicity(): void
87
87
{
88
88
$ account1 = new FioAccount ('323536 ' , 'foo ' );
89
89
$ account2 = new FioAccount ('978654 ' , 'bar ' );
90
- $ accounts = new AccountCollection ;
90
+ $ accounts = new AccountCollection () ;
91
91
$ accounts ->addAccount ('foo ' , $ account1 );
92
92
$ accounts ->addAccount ('foo ' , $ account2 );
93
93
}
@@ -118,6 +118,23 @@ public function testAccountCollectionFactoryThrowToken(): void
118
118
}, InvalidArgument::class, 'Key "token" is required for alias "foo". ' );
119
119
}
120
120
121
+ public function testKeysLikeNumber (): void
122
+ {
123
+ $ collections = AccountCollectionFactory::create ([
124
+ '1 ' => [
125
+ 'account ' => '123456/0800 ' ,
126
+ 'token ' => 'bar ' ,
127
+ ],
128
+ 2 => [
129
+ 'account ' => '987564/0800 ' ,
130
+ 'token ' => 'foo ' ,
131
+ ],
132
+ ]);
133
+
134
+ Assert::same ('bar ' , $ collections ->account ('1 ' )->getToken ());
135
+ Assert::same ('foo ' , $ collections ->account ('2 ' )->getToken ());
136
+ }
137
+
121
138
}
122
139
123
140
(new AccountCollectionTest ())->run ();
0 commit comments