Esempio n. 1
0
 public function testGetValuesLoadsInnerListOnFirstCall()
 {
     $this->loader->expects($this->once())->method('loadChoiceList')->with($this->value)->will($this->returnValue($this->innerList));
     $this->innerList->expects($this->exactly(2))->method('getValues')->will($this->returnValue('RESULT'));
     $this->assertSame('RESULT', $this->list->getValues());
     $this->assertSame('RESULT', $this->list->getValues());
 }
 public function testGetValuesLoadsLoadedListOnFirstCall()
 {
     $this->loader->expects($this->exactly(2))->method('loadChoiceList')->with($this->value)->will($this->returnValue($this->loadedList));
     // The same list is returned by the loader
     $this->loadedList->expects($this->exactly(2))->method('getValues')->will($this->returnValue('RESULT'));
     $this->assertSame('RESULT', $this->list->getValues());
     $this->assertSame('RESULT', $this->list->getValues());
 }