CRM-17385 - CRM_Extension_BrowserTest
authorTim Otten <totten@civicrm.org>
Mon, 12 Oct 2015 20:35:20 +0000 (21:35 +0100)
committerTim Otten <totten@civicrm.org>
Mon, 12 Oct 2015 20:35:20 +0000 (21:35 +0100)
tests/phpunit/CRM/Extension/BrowserTest.php
tests/phpunit/CRM/Extension/dataset/good-repository/single [new file with mode: 0644]
tests/phpunit/CRM/Extension/dataset/good-repository/test.crm.extension.browsertest.a.xml [deleted file]
tests/phpunit/CRM/Extension/dataset/good-repository/test.crm.extension.browsertest.b.xml [deleted file]

index 811d5f1cbffca1c1f9b5f83b6b699c10a810ca4c..e739aa92bbb10a628b02762b473f9bdb6df37c78 100644 (file)
@@ -22,21 +22,21 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase {
   }
 
   public function testCheckRequirements_BadCachedir_false() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', FALSE);
+    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', NULL, FALSE);
     $this->assertEquals(TRUE, $browser->isEnabled());
     $reqs = $browser->checkRequirements();
     $this->assertEquals(1, count($reqs));
   }
 
   public function testCheckRequirements_BadCachedir_nonexistent() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', '/tot/all/yin/v/alid');
+    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', NULL, '/tot/all/yin/v/alid');
     $this->assertEquals(TRUE, $browser->isEnabled());
     $reqs = $browser->checkRequirements();
     $this->assertEquals(1, count($reqs));
   }
 
   public function testGetExtensions_good() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', NULL, $this->createTempDir('ext-cache-'));
     $this->assertEquals(TRUE, $browser->isEnabled());
     $this->assertEquals(array(), $browser->checkRequirements());
     $exts = $browser->getExtensions();
@@ -50,7 +50,7 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase {
   }
 
   public function testGetExtension_good() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', NULL, $this->createTempDir('ext-cache-'));
     $this->assertEquals(TRUE, $browser->isEnabled());
     $this->assertEquals(array(), $browser->checkRequirements());
 
@@ -60,7 +60,7 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase {
   }
 
   public function testGetExtension_nonexistent() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', NULL, $this->createTempDir('ext-cache-'));
     $this->assertEquals(TRUE, $browser->isEnabled());
     $this->assertEquals(array(), $browser->checkRequirements());
 
diff --git a/tests/phpunit/CRM/Extension/dataset/good-repository/single b/tests/phpunit/CRM/Extension/dataset/good-repository/single
new file mode 100644 (file)
index 0000000..35c7f95
--- /dev/null
@@ -0,0 +1 @@
+{"test.crm.extension.browsertest.a":"<extension key='test.crm.extension.browsertest.a' type='report'>\n  <file>main<\/file>\n  <name>test_crm_extension_browsertest_a<\/name>\n  <description>Brought to you by the letter \"A\"<\/description>\n  <version>0.1<\/version>\n  <downloadUrl>http:\/\/example.com\/test.crm.extension.browsertest.a-0.1.zip<\/downloadUrl>\n  <typeInfo>\n    <reportUrl>test\/extension\/browsertest\/a<\/reportUrl>\n    <component>CiviContribute<\/component>\n  <\/typeInfo>\n<\/extension>\n","test.crm.extension.browsertest.b":"<extension key='test.crm.extension.browsertest.b' type='module'>\n  <file>moduletest<\/file>\n  <name>test_crm_extension_browsertest_b<\/name>\n  <version>1.2<\/version>\n  <downloadUrl>http:\/\/example.com\/test.crm.extension.browsertest.b-1.2.zip<\/downloadUrl>\n  <description>Brought to you by the letter \"B\"<\/description>\n<\/extension>\n"}
\ No newline at end of file
diff --git a/tests/phpunit/CRM/Extension/dataset/good-repository/test.crm.extension.browsertest.a.xml b/tests/phpunit/CRM/Extension/dataset/good-repository/test.crm.extension.browsertest.a.xml
deleted file mode 100644 (file)
index 4898b99..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<extension key='test.crm.extension.browsertest.a' type='report'>
-  <file>main</file>
-  <name>test_crm_extension_browsertest_a</name>
-  <description>Brought to you by the letter "A"</description>
-  <version>0.1</version>
-  <downloadUrl>http://example.com/test.crm.extension.browsertest.a-0.1.zip</downloadUrl>
-  <typeInfo>
-    <reportUrl>test/extension/browsertest/a</reportUrl>
-    <component>CiviContribute</component>
-  </typeInfo>
-</extension>
diff --git a/tests/phpunit/CRM/Extension/dataset/good-repository/test.crm.extension.browsertest.b.xml b/tests/phpunit/CRM/Extension/dataset/good-repository/test.crm.extension.browsertest.b.xml
deleted file mode 100644 (file)
index bdd2fdd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<extension key='test.crm.extension.browsertest.b' type='module'>
-  <file>moduletest</file>
-  <name>test_crm_extension_browsertest_b</name>
-  <version>1.2</version>
-  <downloadUrl>http://example.com/test.crm.extension.browsertest.b-1.2.zip</downloadUrl>
-  <description>Brought to you by the letter "B"</description>
-</extension>