/**
  * @test
  * @group library
  */
 public function test_exportTemplateSnippetShouldOnlyExportLocalSnippets()
 {
     // ARRANGE
     $websiteId = 'SITE-export0t-empl-ates-nipp-et0test00001-SITE';
     $exportFileName = 'templateSnippetExport';
     $allSnippets = $this->getAllTemplateSnippets($websiteId);
     $expectedExportedSnippetIds = array();
     foreach ($allSnippets as $snippet) {
         if ($snippet->getSourceType() == SourceItem::SOURCE_LOCAL) {
             $expectedExportedSnippetIds[] = $snippet->getId();
         }
     }
     // check if min. one global snippet exists
     $this->assertLessThan(count($allSnippets), count($expectedExportedSnippetIds));
     // ACT
     $this->business->exportWebsite($websiteId, $exportFileName, true, false);
     // ASSERT
     $createdZipFiles = $this->business->phpunit_getCreatedZipFiles();
     $this->assertCount(1, $createdZipFiles);
     $exportedSnippetIds = $this->getTemplateSnippetIdsFromExportFile($createdZipFiles[0]);
     sort($exportedSnippetIds);
     sort($expectedExportedSnippetIds);
     $this->assertEquals($expectedExportedSnippetIds, $exportedSnippetIds);
 }
Beispiel #2
0
 protected function tearDown()
 {
     $this->business->phpunitTearDown();
     parent::tearDown();
 }