@@ -12,6 +12,7 @@ class ZoneTest extends \PHPUnit_Framework_TestCase
1212
1313 protected $ bucketName ;
1414 protected $ bucketNameBC ;
15+ protected $ bucketNameNA ;
1516
1617
1718 protected function setUp ()
@@ -22,6 +23,9 @@ protected function setUp()
2223 global $ bucketNameBC ;
2324 $ this ->bucketNameBC = $ bucketNameBC ;
2425
26+ global $ bucketNameNA ;
27+ $ this ->bucketNameNA = $ bucketNameNA ;
28+
2529 global $ accessKey ;
2630 $ this ->ak = $ accessKey ;
2731
@@ -32,23 +36,37 @@ protected function setUp()
3236 public function testUpHosts ()
3337 {
3438
39+ // test nb http
3540 list ($ upHosts , $ err ) = $ this ->zone ->getUpHosts ($ this ->ak , $ this ->bucketName );
3641 $ this ->assertNull ($ err );
3742 $ this ->assertEquals ('http://up.qiniu.com ' , $ upHosts [0 ]);
3843 $ this ->assertEquals ('http://upload.qiniu.com ' , $ upHosts [1 ]);
3944
45+ // test bc http
4046 list ($ upHosts , $ err ) = $ this ->zone ->getUpHosts ($ this ->ak , $ this ->bucketNameBC );
4147 $ this ->assertNull ($ err );
4248 $ this ->assertEquals ('http://up-z1.qiniu.com ' , $ upHosts [0 ]);
4349 $ this ->assertEquals ('http://upload-z1.qiniu.com ' , $ upHosts [1 ]);
4450
51+ // test na http
52+ list ($ upHosts , $ err ) = $ this ->zone ->getUpHosts ($ this ->ak , $ this ->bucketNameNA );
53+ $ this ->assertNull ($ err );
54+ $ this ->assertEquals ('http://up-na0.qiniu.com ' , $ upHosts [0 ]);
55+
56+ // test nb https
4557 list ($ upHosts , $ err ) = $ this ->zoneHttps ->getUpHosts ($ this ->ak , $ this ->bucketName );
4658 $ this ->assertNull ($ err );
4759 $ this ->assertEquals ('https://up.qbox.me ' , $ upHosts [0 ]);
4860
61+ // test bc https
4962 list ($ upHosts , $ err ) = $ this ->zoneHttps ->getUpHosts ($ this ->ak , $ this ->bucketNameBC );
5063 $ this ->assertNull ($ err );
5164 $ this ->assertEquals ('https://up-z1.qbox.me ' , $ upHosts [0 ]);
65+
66+ // test na https
67+ list ($ upHosts , $ err ) = $ this ->zoneHttps ->getUpHosts ($ this ->ak , $ this ->bucketNameNA );
68+ $ this ->assertNull ($ err );
69+ $ this ->assertEquals ('https://up-na0.qbox.me ' , $ upHosts [0 ]);
5270 }
5371
5472 public function testUpHostByToken ()
@@ -82,16 +100,28 @@ public function testUpHostByToken()
82100 public function testIoHosts ()
83101 {
84102
103+ // test nb http
85104 $ ioHost = $ this ->zone ->getIoHost ($ this ->ak , $ this ->bucketName );
86105 $ this ->assertEquals ('http://iovip.qbox.me ' , $ ioHost );
87106
107+ // test bc http
88108 $ ioHost = $ this ->zone ->getIoHost ($ this ->ak , $ this ->bucketNameBC );
89109 $ this ->assertEquals ('http://iovip-z1.qbox.me ' , $ ioHost );
90110
111+ // test na http
112+ $ ioHost = $ this ->zone ->getIoHost ($ this ->ak , $ this ->bucketNameNA );
113+ $ this ->assertEquals ('http://iovip-na0.qbox.me ' , $ ioHost );
114+
115+ // test nb https
91116 $ ioHost = $ this ->zoneHttps ->getIoHost ($ this ->ak , $ this ->bucketName );
92117 $ this ->assertEquals ('https://iovip.qbox.me ' , $ ioHost );
93118
119+ // test bc https
94120 $ ioHost = $ this ->zoneHttps ->getIoHost ($ this ->ak , $ this ->bucketNameBC );
95121 $ this ->assertEquals ('https://iovip-z1.qbox.me ' , $ ioHost );
122+
123+ // test na https
124+ $ ioHost = $ this ->zoneHttps ->getIoHost ($ this ->ak , $ this ->bucketNameNA );
125+ $ this ->assertEquals ('https://iovip-na0.qbox.me ' , $ ioHost );
96126 }
97127}
0 commit comments