Ejemplo n.º 1
0
 public function testRepairFilecache()
 {
     $this->consoleInput->method('getOption')->with('repair-filecache')->willReturn(true);
     $this->detector->expects($this->once())->method('getAllMappings')->willReturn(['ext' => ['testing/existingmimetype']]);
     $this->loader->expects($this->exactly(1))->method('exists')->will($this->returnValueMap([['testing/existingmimetype', true]]));
     $this->loader->expects($this->exactly(1))->method('getId')->will($this->returnValueMap([['testing/existingmimetype', 1]]));
     $this->loader->expects($this->once())->method('updateFilecache')->with('ext', 1)->willReturn(3);
     $this->consoleOutput->expects($this->at(0))->method('writeln')->with('Updated 3 filecache rows for mimetype "testing/existingmimetype"');
     $this->consoleOutput->expects($this->at(1))->method('writeln')->with('Added 0 new mimetypes');
     $this->consoleOutput->expects($this->at(2))->method('writeln')->with('Updated 3 filecache rows');
     self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider dataGetPreviewPathFromMimeType
  * @param string $mimeType
  * @param string $icon
  * @param string $expected
  */
 public function testGetPreviewPathFromMimeType($mimeType, $icon, $expected)
 {
     $this->mimeTypeDetector->expects($this->once())->method('mimeTypeIcon')->with($mimeType)->willReturn($icon);
     $this->assertSame($expected, $this->invokePrivate($this->controller, 'getPreviewPathFromMimeType', [$mimeType]));
 }