Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiTest.php |
— | — | @@ -141,6 +141,7 @@ |
142 | 142 | $sxe = simplexml_load_string( $req->getContent() ); |
143 | 143 | $this->assertNotType( "bool", $sxe ); |
144 | 144 | $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); |
| 145 | + $this->assertNotType( "null", $sxe->login[0] ); |
145 | 146 | |
146 | 147 | $a = $sxe->login[0]->attributes()->result[0]; |
147 | 148 | $this->assertEquals( ' result="NeedToken"', $a->asXML() ); |
— | — | @@ -179,6 +180,7 @@ |
180 | 181 | $sxe = simplexml_load_string( $req->getContent() ); |
181 | 182 | $this->assertNotType( "bool", $sxe ); |
182 | 183 | $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); |
| 184 | + $this->assertNotType( "null", $sxe->login[0] ); |
183 | 185 | |
184 | 186 | $a = $sxe->login[0]->attributes()->result[0]; |
185 | 187 | $this->assertEquals( ' result="NeedToken"', $a->asXML() ); |
— | — | @@ -191,8 +193,9 @@ |
192 | 194 | $req->execute(); |
193 | 195 | |
194 | 196 | $cj = $req->getCookieJar(); |
195 | | - $this->assertRegexp( '/_session=[^;]*; .*UserID=[0-9]*; .*UserName=' . self::$userName . '; .*Token=/', |
196 | | - $cj->serializeToHttpRequest( $wgScriptPath, $wgServerName ) ); |
| 197 | + $serializedCookie = $cj->serializeToHttpRequest( $wgScriptPath, $wgServerName ); |
| 198 | + $this->assertNotEquals( '', $serializedCookie ); |
| 199 | + $this->assertRegexp( '/_session=[^;]*; .*UserID=[0-9]*; .*UserName=' . self::$userName . '; .*Token=/', $serializedCookie ); |
197 | 200 | |
198 | 201 | |
199 | 202 | return $cj; |