|
@@ 135-150 (lines=16) @@
|
| 132 |
|
$this->assertFalse($this->model->collectRates($this->getRateRequest())); |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
public function testCollectRatesNoAllowedMethods() |
| 136 |
|
{ |
| 137 |
|
$this->mockIsActive(true); |
| 138 |
|
$rate = $this->getMethod('International Standard Small Parcel'); |
| 139 |
|
|
| 140 |
|
$this->mockMethodsConfigured(false); |
| 141 |
|
$this->mockLibraryRates([$rate]); |
| 142 |
|
$this->mockAllMethods(['i11lstdsmprcl' |
| 143 |
|
=> "International Standard Small Parcel" |
| 144 |
|
]); |
| 145 |
|
$this->mockHasResults(false); |
| 146 |
|
|
| 147 |
|
$result = $this->model->collectRates($this->getRateRequest()); |
| 148 |
|
$this->assertInstanceOf('Magento\Shipping\Model\Rate\Result', $result); |
| 149 |
|
|
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
public function testCollectRatesDisabledMethods() |
| 153 |
|
{ |
|
@@ 152-167 (lines=16) @@
|
| 149 |
|
|
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
public function testCollectRatesDisabledMethods() |
| 153 |
|
{ |
| 154 |
|
$this->mockIsActive(true); |
| 155 |
|
|
| 156 |
|
$rate = $this->getMethod('International Standard Medium Parcel'); |
| 157 |
|
|
| 158 |
|
$this->mockMethodsConfigured('i11lstdsmprcl'); |
| 159 |
|
$this->mockLibraryRates([$rate]); |
| 160 |
|
$this->mockAllMethods(['i11lstdsmprcl' |
| 161 |
|
=> "International Standard Small Parcel" |
| 162 |
|
]); |
| 163 |
|
$this->mockHasResults(false); |
| 164 |
|
|
| 165 |
|
$result = $this->model->collectRates($this->getRateRequest()); |
| 166 |
|
$this->assertInstanceOf('Magento\Shipping\Model\Rate\Result', $result); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
public function testCollectRatesMediumParcels() |
| 170 |
|
{ |
|
@@ 169-183 (lines=15) @@
|
| 166 |
|
$this->assertInstanceOf('Magento\Shipping\Model\Rate\Result', $result); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
public function testCollectRatesMediumParcels() |
| 170 |
|
{ |
| 171 |
|
$this->mockIsActive(true); |
| 172 |
|
$rate = $this->getMethod('International Standard Small Parcel'); |
| 173 |
|
$this->mockMethodsConfigured('i11lstdsmprcl'); |
| 174 |
|
$this->mockLibraryRates([$rate]); |
| 175 |
|
$this->mockParcelSize(ParcelSize::MEDIUM); |
| 176 |
|
$this->mockAllMethods(['i11lstdsmprcl' |
| 177 |
|
=> "International Standard Small Parcel" |
| 178 |
|
]); |
| 179 |
|
$this->mockHasResults(false); |
| 180 |
|
|
| 181 |
|
$result = $this->model->collectRates($this->getRateRequest()); |
| 182 |
|
$this->assertInstanceOf('Magento\Shipping\Model\Rate\Result', $result); |
| 183 |
|
} |
| 184 |
|
|
| 185 |
|
public function testCollectRatesInLbs() |
| 186 |
|
{ |
|
@@ 213-226 (lines=14) @@
|
| 210 |
|
|
| 211 |
|
} |
| 212 |
|
|
| 213 |
|
public function testCollectRates() |
| 214 |
|
{ |
| 215 |
|
$this->mockIsActive(true); |
| 216 |
|
$rate = $this->getMethod('International Standard Small Parcel'); |
| 217 |
|
$this->mockMethodsConfigured('i11lstdsmprcl'); |
| 218 |
|
$this->mockLibraryRates([$rate]); |
| 219 |
|
$this->mockAllMethods(['i11lstdsmprcl' |
| 220 |
|
=> "International Standard Small Parcel" |
| 221 |
|
]); |
| 222 |
|
$this->mockHasResults(true); |
| 223 |
|
|
| 224 |
|
$result = $this->model->collectRates($this->getRateRequest()); |
| 225 |
|
$this->assertInstanceOf('Magento\Shipping\Model\Rate\Result', $result); |
| 226 |
|
} |
| 227 |
|
|
| 228 |
|
/** |
| 229 |
|
* Get a shipping Method |