Skip to content

Commit

Permalink
#62: Move database setup to traits+bootstrap for phpunit 10 compatabi…
Browse files Browse the repository at this point in the history
…lity.

There isn't a TestSuite class any more for this purpose.
  • Loading branch information
adamfranco committed Aug 8, 2024
1 parent c8c93b3 commit f1a2068
Show file tree
Hide file tree
Showing 81 changed files with 268 additions and 700 deletions.
56 changes: 0 additions & 56 deletions application/test/ApplicationTestSuite.php

This file was deleted.

2 changes: 2 additions & 0 deletions application/test/Catalog/Action/Helper/OsidIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class Catalog_Action_Helper_OsidIdTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
2 changes: 2 additions & 0 deletions application/test/Catalog/Action/Helper/OsidTermsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class Catalog_Action_Helper_OsidTermsTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
2 changes: 2 additions & 0 deletions application/test/Catalog/Action/Helper/OsidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class Catalog_Action_Helper_OsidTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
2 changes: 2 additions & 0 deletions application/test/Catalog/Action/Helper/OsidTopicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class Catalog_Action_Helper_OsidTopicTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
2 changes: 2 additions & 0 deletions application/test/Catalog/Action/Helper/OsidTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class Catalog_Action_Helper_OsidTypeTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
2 changes: 2 additions & 0 deletions application/test/Catalog/Action/Helper/OsidTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class Catalog_Action_Helper_OsidTypesTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
21 changes: 21 additions & 0 deletions application/test/Catalog/ApplicationTestTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

trait Catalog_ApplicationTestTrait {

use banner_DatabaseTestTrait;

public static function setUpBeforeClass(): void
{
self::setUpDatabase();

Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/controllers/helper', 'Helper');
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/resources/Catalog/Action/Helper', 'Catalog_Action_Helper');
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/resources/Auth/Action/Helper', 'Auth_Action_Helper');

$registry = Zend_Registry::getInstance();
$registry->config = new Zend_Config_Ini(dirname(__FILE__).'/frontend_config.ini', 'development');

Zend_Controller_Action_HelperBroker::getStaticHelper('Osid')->setConfigPath(dirname(__FILE__).'/../apc/configuration.plist');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class GetTimeStringHelperTest extends TestCase
{

use Catalog_ApplicationTestTrait;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
Expand Down
31 changes: 0 additions & 31 deletions application/test/TestSuite.php

This file was deleted.

30 changes: 0 additions & 30 deletions application/test/apc/TestSuite.php

This file was deleted.

3 changes: 2 additions & 1 deletion application/test/apc/course/Course/Catalog/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Catalog_SessionTest
extends banner_course_Course_Catalog_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Lookup_CombinedSessionTest
extends banner_course_Course_Lookup_CombinedSessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
3 changes: 2 additions & 1 deletion application/test/apc/course/Course/Lookup/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Lookup_SessionTest
extends banner_course_Course_Lookup_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
3 changes: 2 additions & 1 deletion application/test/apc/course/Course/Search/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Search_OrderTest
extends banner_course_Course_Search_OrderTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
3 changes: 2 additions & 1 deletion application/test/apc/course/Course/Search/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Search_QueryTest
extends banner_course_Course_Search_QueryTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
3 changes: 2 additions & 1 deletion application/test/apc/course/Course/Search/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Search_SearchTest
extends banner_course_Course_Search_SearchTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
3 changes: 2 additions & 1 deletion application/test/apc/course/Course/Search/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_Course_Search_SessionTest
extends banner_course_Course_Search_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseCatalog_Lookup_SessionTest
extends banner_course_CourseCatalog_Lookup_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
3 changes: 2 additions & 1 deletion application/test/apc/course/CourseCatalogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseCatalogTest
extends banner_course_CourseCatalogTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
2 changes: 1 addition & 1 deletion application/test/apc/course/CourseManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class apc_course_CourseManagerTest
*
* @access protected
*/
protected function setUp()
protected function setUp(): void
{
$this->mcugId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:catalog/MCUG');
$this->manager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Catalog_SessionTest
extends banner_course_CourseOffering_Catalog_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Lookup_CombinedSessionTest
extends banner_course_CourseOffering_Lookup_CombinedSessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Lookup_SessionTest
extends banner_course_CourseOffering_Lookup_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Search_OrderTest
extends banner_course_CourseOffering_Search_OrderTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Search_QueryTest
extends banner_course_CourseOffering_Search_QueryTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Search_SearchTest
extends banner_course_CourseOffering_Search_SearchTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class apc_course_CourseOffering_Search_SessionTest
extends banner_course_CourseOffering_Search_SessionTest
{

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(realpath(dirname(__FILE__).'/../../../').'/configuration.plist');
self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0');
}
Expand Down
Loading

0 comments on commit f1a2068

Please sign in to comment.