|
@@ 119-139 (lines=21) @@
|
| 116 |
|
* @expectedException Radowoj\Yaah\Exception
|
| 117 |
|
* @expectedExceptionMessage Invalid WebAPI doLogin[Enc]() response
|
| 118 |
|
*/
|
| 119 |
|
public function testExceptionOnInvalidLoginResponseMissingUserId()
|
| 120 |
|
{
|
| 121 |
|
$config = $this->getConfig();
|
| 122 |
|
|
| 123 |
|
$soapClient = $this->getMockBuilder(SoapClient::class)
|
| 124 |
|
->disableOriginalConstructor()
|
| 125 |
|
->setMethods(['doLoginEnc', 'doQuerySysStatus', 'doSomethingAfterLogin'])
|
| 126 |
|
->getMock();
|
| 127 |
|
|
| 128 |
|
//Allegro version key should be requested for first login per request
|
| 129 |
|
$soapClient->expects($this->once())
|
| 130 |
|
->method('doQuerySysStatus')
|
| 131 |
|
->willReturn((object)['verKey' => 'someVersionKey']);
|
| 132 |
|
|
| 133 |
|
//login
|
| 134 |
|
$soapClient->expects($this->once())
|
| 135 |
|
->method('doLoginEnc')
|
| 136 |
|
->willReturn((object)['sessionHandlePart' => 'foo']);
|
| 137 |
|
|
| 138 |
|
$client = new Client($config, $soapClient);
|
| 139 |
|
}
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
/**
|
|
@@ 146-166 (lines=21) @@
|
| 143 |
|
* @expectedException Radowoj\Yaah\Exception
|
| 144 |
|
* @expectedExceptionMessage Invalid WebAPI doLogin[Enc]() response
|
| 145 |
|
*/
|
| 146 |
|
public function testExceptionOnInvalidLoginResponseMissingSessionHandlePart()
|
| 147 |
|
{
|
| 148 |
|
$config = $this->getConfig();
|
| 149 |
|
|
| 150 |
|
$soapClient = $this->getMockBuilder(SoapClient::class)
|
| 151 |
|
->disableOriginalConstructor()
|
| 152 |
|
->setMethods(['doLoginEnc', 'doQuerySysStatus', 'doSomethingAfterLogin'])
|
| 153 |
|
->getMock();
|
| 154 |
|
|
| 155 |
|
//Allegro version key should be requested for first login per request
|
| 156 |
|
$soapClient->expects($this->once())
|
| 157 |
|
->method('doQuerySysStatus')
|
| 158 |
|
->willReturn((object)['verKey' => 'someVersionKey']);
|
| 159 |
|
|
| 160 |
|
//login
|
| 161 |
|
$soapClient->expects($this->once())
|
| 162 |
|
->method('doLoginEnc')
|
| 163 |
|
->willReturn((object)['userId' => 'bar']);
|
| 164 |
|
|
| 165 |
|
$client = new Client($config, $soapClient);
|
| 166 |
|
}
|
| 167 |
|
|
| 168 |
|
|
| 169 |
|
/**
|