Fetch XML file paths from Workbook Relationships
This commit is contained in:
1 parent
0c8a53c821
commit
e2b519d6f9
9 files changed
+226
-33
No files matched your search
@@ -51,8 +51,16 @@ class SharedStringsManagerTest extends \PHPUnit_Framework_TestCase
|
||||
$helperFactory = new HelperFactory();
|
||||
$managerFactory = new ManagerFactory($helperFactory, $cachingStrategyFactory);
|
||||
$entityFactory = new EntityFactory($managerFactory, $helperFactory);
|
||||
$workbookRelationshipsManager = new WorkbookRelationshipsManager($resourcePath, $entityFactory);
|
||||
|
||||
$this->sharedStringsManager = new SharedStringsManager($resourcePath, $tempFolder, $entityFactory, $helperFactory, $cachingStrategyFactory);
|
||||
$this->sharedStringsManager = new SharedStringsManager(
|
||||
$resourcePath,
|
||||
$tempFolder,
|
||||
$workbookRelationshipsManager,
|
||||
$entityFactory,
|
||||
$helperFactory,
|
||||
$cachingStrategyFactory
|
||||
);
|
||||
|
||||
return $this->sharedStringsManager;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
namespace Box\Spout\Reader\XLSX\Manager;
|
||||
|
||||
use Box\Spout\Reader\XLSX\Creator\EntityFactory;
|
||||
use Box\Spout\Reader\XLSX\Creator\HelperFactory;
|
||||
use Box\Spout\Reader\XLSX\Creator\ManagerFactory;
|
||||
use Box\Spout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyFactory;
|
||||
|
||||
/**
|
||||
* Class StyleManagerTest
|
||||
@@ -19,13 +16,12 @@ class StyleManagerTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
private function getStyleManagerMock($styleAttributes = [], $customNumberFormats = [])
|
||||
{
|
||||
$helperFactory = new HelperFactory();
|
||||
$managerFactory = new ManagerFactory($helperFactory, new CachingStrategyFactory());
|
||||
$entityFactory = new EntityFactory($managerFactory, $helperFactory);
|
||||
$entityFactory = $this->createMock(EntityFactory::class);
|
||||
$workbookRelationshipsManager = $this->createMock(WorkbookRelationshipsManager::class);
|
||||
|
||||
/** @var StyleManager $styleManager */
|
||||
$styleManager = $this->getMockBuilder('\Box\Spout\Reader\XLSX\Manager\StyleManager')
|
||||
->setConstructorArgs(['/path/to/file.xlsx', $entityFactory])
|
||||
->setConstructorArgs(['/path/to/file.xlsx', $workbookRelationshipsManager, $entityFactory])
|
||||
->setMethods(['getCustomNumberFormats', 'getStylesAttributes'])
|
||||
->getMock();
|
||||
|
||||
|
||||
@@ -169,6 +169,23 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($expectedRows, $allRows);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testReadShouldSupportFilesWithCapitalSharedStringsFileName()
|
||||
{
|
||||
$allRows = $this->getAllRowsForFile('one_sheet_with_capital_shared_strings_filename.xlsx');
|
||||
|
||||
$expectedRows = [
|
||||
['s1--A1', 's1--B1', 's1--C1', 's1--D1', 's1--E1'],
|
||||
['s1--A2', 's1--B2', 's1--C2', 's1--D2', 's1--E2'],
|
||||
['s1--A3', 's1--B3', 's1--C3', 's1--D3', 's1--E3'],
|
||||
['s1--A4', 's1--B4', 's1--C4', 's1--D4', 's1--E4'],
|
||||
['s1--A5', 's1--B5', 's1--C5', 's1--D5', 's1--E5'],
|
||||
];
|
||||
$this->assertEquals($expectedRows, $allRows);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user