Exemplo n.º 1
0
 /**
  * Test for get method with primary scope
  *
  * @dataProvider providerGet
  * @param string $filename
  * @param array $fileList
  * @SuppressWarnings(PHPMD.UnusedLocalVariable)
  */
 public function testGetPrimary($filename, $fileList)
 {
     $scope = 'primary';
     $directory = $this->getMock('Magento\\Framework\\Filesystem\\Directory\\Read', ['search', 'getRelativePath'], [], '', false);
     $directory->expects($this->once())->method('search')->with(sprintf('{%1$s,*/%1$s}', $filename))->will($this->returnValue($fileList));
     $this->filesystem->expects($this->once())->method('getDirectoryRead')->with(DirectoryList::CONFIG)->will($this->returnValue($directory));
     $this->iteratorFactory->expects($this->once())->method('create')->with($directory, $fileList)->will($this->returnValue(true));
     $this->assertTrue($this->model->get($filename, $scope));
 }
 public function testGetDefault()
 {
     $expected = new \StdClass();
     $this->factory->expects($this->once())->method('create')->with([])->willReturn($expected);
     $this->assertSame($expected, $this->object->get('file', 'unknown'));
 }