コード例 #1
0
 public function testReturnsSetupPath()
 {
     $editionPathSelector = $this->getEditionPathSelectorMock();
     $editionPathSelector = new EditionPathProvider($editionPathSelector);
     $this->assertSame('/Setup/', $editionPathSelector->getSetupDirectory());
 }
コード例 #2
0
ファイル: SetupTest.php プロジェクト: Crease29/oxideshop_ce
 /**
  * Test if sql files don't have invalid encoding.
  */
 public function testSqlFilesForInvalidEncoding()
 {
     $pathProvider = new EditionPathProvider(new EditionRootPathProvider(new EditionSelector()));
     $filePathPattern = $pathProvider->getSetupDirectory() . '/Sql/*.sql';
     foreach (glob($filePathPattern) as $sFilePath) {
         if (is_readable($sFilePath)) {
             $sFileContent = file_get_contents($sFilePath);
             foreach (array(0xef, 0xbb, 0xbf, 0x9c) as $sCharacter) {
                 $this->assertFalse(strpos($sFileContent, $sCharacter), "Character with invalid encoding found in {$sFilePath} file.");
             }
         }
     }
 }