Ejemplo n.º 1
0
 /**
  * @dataProvider provideVersions
  * @test
  */
 public function areProvidedVersionsCreatedShouldReturnExpectedResults($resourceVersions, $pluginVersions, $sharedVersionsAllowed, $expectResourceGetVersions)
 {
     $this->plugin->expects($this->any())->method('areSharedVersionsAllowed')->will($this->returnValue($sharedVersionsAllowed));
     $resource = $this->getMockedResource();
     $file = $this->getMockedFile();
     $file->expects($this->any())->method('getResource')->will($this->returnValue($resource));
     $this->plugin->expects($this->atLeastOnce())->method('areSharedVersionsAllowed')->will($this->returnValue(false));
     $this->plugin->expects($this->any())->method('getProvidedVersions')->will($this->returnValue($pluginVersions));
     if ($expectResourceGetVersions) {
         $resource->expects($this->atLeastOnce())->method('hasVersion')->with($this->equalTo(Version::get('tussi')))->will($this->returnValue(true));
     } else {
         $file->expects($this->atLeastOnce())->method('hasVersion')->with($this->equalTo(Version::get('tussi')))->will($this->returnValue(true));
     }
     $this->assertEquals(true, $this->plugin->areProvidedVersionsCreated($file));
 }