tests/phpunit - Declare `@group headless`
[civicrm-core.git] / tests / phpunit / CRM / Extension / BrowserTest.php
index 08e5d5e16c21c510668c8d95ef3c91fff1e664ab..065b94ce13a649f3d8ed4578d98d9061bd92358f 100644 (file)
@@ -1,42 +1,41 @@
 <?php
 
-require_once 'CiviTest/CiviUnitTestCase.php';
-
 /**
  * Class CRM_Extension_BrowserTest
+ * @group headless
  */
 class CRM_Extension_BrowserTest extends CiviUnitTestCase {
-  function setUp() {
+  public function setUp() {
     parent::setUp();
   }
 
-  function tearDown() {
+  public function tearDown() {
     parent::tearDown();
   }
 
-  function testDisabled() {
+  public function testDisabled() {
     $browser = new CRM_Extension_Browser(FALSE, '/index.html', 'file:///itd/oesn/tmat/ter');
     $this->assertEquals(FALSE, $browser->isEnabled());
     $this->assertEquals(array(), $browser->checkRequirements());
     $this->assertEquals(array(), $browser->getExtensions());
   }
 
-  function testCheckRequirements_BadCachedir_false() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', FALSE);
+  public function testCheckRequirements_BadCachedir_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));
   }
 
-  function testCheckRequirements_BadCachedir_nonexistent() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', '/tot/all/yin/v/alid');
+  public function testCheckRequirements_BadCachedir_nonexistent() {
+    $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));
   }
 
-  function testGetExtensions_good() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+  public function testGetExtensions_good() {
+    $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();
@@ -49,8 +48,8 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase {
     $this->assertEquals('http://example.com/test.crm.extension.browsertest.b-1.2.zip', $exts['test.crm.extension.browsertest.b']->downloadUrl);
   }
 
-  function testGetExtension_good() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+  public function testGetExtension_good() {
+    $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());
 
@@ -59,12 +58,13 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase {
     $this->assertEquals('http://example.com/test.crm.extension.browsertest.b-1.2.zip', $info->downloadUrl);
   }
 
-  function testGetExtension_nonexistent() {
-    $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+  public function testGetExtension_nonexistent() {
+    $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());
 
     $info = $browser->getExtension('test.crm.extension.browsertest.nonexistent');
     $this->assertEquals(NULL, $info);
   }
+
 }