|
10 | 10 | class UrlTest extends \PHPUnit_Framework_TestCase
|
11 | 11 | {
|
12 | 12 |
|
13 |
| - public function testInvalidArguments() |
| 13 | + public function testInvalidArgument1() |
14 | 14 | {
|
15 | 15 | $this->setExpectedException(get_class(new \InvalidArgumentException()));
|
16 | 16 | new QueryParameter(1, 1);
|
| 17 | + } |
| 18 | + |
| 19 | + public function testInvalidArgument2() |
| 20 | + { |
17 | 21 | $this->setExpectedException(get_class(new \InvalidArgumentException()));
|
18 | 22 | new QueryParameter('arg1', new \Exception());
|
| 23 | + } |
| 24 | + |
| 25 | + public function testInvalidArgument3() |
| 26 | + { |
| 27 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
19 | 28 | new Url(array());
|
| 29 | + } |
| 30 | + |
| 31 | + public function testInvalidArgument4() |
| 32 | + { |
| 33 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
20 | 34 | $url = new Url( 'https://john:[email protected]:8443/path/to/resource');
|
21 | 35 | $url->setScheme(1.4);
|
| 36 | + } |
| 37 | + |
| 38 | + public function testInvalidArgument5() |
| 39 | + { |
| 40 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 41 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
22 | 42 | $url->setHostname(0);
|
| 43 | + } |
| 44 | + |
| 45 | + public function testInvalidArgument6() |
| 46 | + { |
| 47 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 48 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
23 | 49 | $url->setPort('invalid');
|
| 50 | + } |
| 51 | + |
| 52 | + public function testInvalidArgument7() |
| 53 | + { |
| 54 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 55 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
24 | 56 | $url->setPath(12);
|
25 |
| - $url->setQueryParameters('asd'); |
| 57 | + } |
| 58 | + |
| 59 | + public function testInvalidArgument9() |
| 60 | + { |
| 61 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 62 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
26 | 63 | $url->setQueryParameters(array('asd'));
|
27 |
| - $url->setQueryParametersFromArray('asd'); |
| 64 | + } |
| 65 | + |
| 66 | + public function testInvalidArgument11() |
| 67 | + { |
| 68 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 69 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
28 | 70 | $url->setQueryParametersFromArray(array(array()));
|
| 71 | + } |
| 72 | + |
| 73 | + public function testInvalidArgument12() |
| 74 | + { |
| 75 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 76 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
29 | 77 | $url->removeQueryParameterByKey(1);
|
| 78 | + } |
| 79 | + |
| 80 | + public function testInvalidArgument13() |
| 81 | + { |
| 82 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 83 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
30 | 84 | $url->setUsername(array());
|
| 85 | + } |
| 86 | + |
| 87 | + public function testInvalidArgument14() |
| 88 | + { |
| 89 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 90 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
31 | 91 | $url->setPassword(array());
|
| 92 | + } |
| 93 | + |
| 94 | + public function testInvalidArgument15() |
| 95 | + { |
| 96 | + $this->setExpectedException(get_class(new \InvalidArgumentException())); |
| 97 | + $url = new Url( 'https://john:[email protected]:8443/path/to/resource'); |
32 | 98 | $url->setFragment(array());
|
33 | 99 | }
|
34 | 100 |
|
|
0 commit comments