예제 #1
0
 public function testGetOperationErrorDescriptionReturnsErrorDescriptionOfStrategyThatDecidesOnError()
 {
     $queue = new StrategiesQueue();
     $target = new UploadTarget('foo');
     $first = new FakeStrategy();
     $second = new FakeStrategy();
     $third = new FakeStrategy();
     $second->fakeDecideOnOtherFailure();
     $queue->attach($first, 300)->attach($second, 200)->attach($third, 100);
     $queue(new UploadedFile(), $target);
     $this->assertSame($queue->getOperationErrorDescription(), $second::OTHER_ERROR_DESCRIPTION);
 }