+ added functions unit testing
[vsc.git] / _tests / functions / functionsTest.php
blobdbf9963deda75a8ec77b591218834d9fd8fa8a09
1 <?php
2 usingPackage ('coreexceptions');
4 class fooFunctionsTest extends UnitTestCase {
6 private $state;
8 public function setUp () {
9 $this->state = get_include_path();
10 set_include_path ('.');
13 public function tearDown() {
14 set_include_path($this->state);
17 public function test_usingPackageReturnPath () {
18 usingPackage ('models');
20 $this->assertEqual(get_include_path(), '.' . PATH_SEPARATOR . LIB_PATH.'/models');
23 public function test_usingPackageBadPackage () {
24 $e = 0;
25 $sPackageName = '...';
26 try {
27 usingPackage ($sPackageName);
28 } catch (Exception $e) {
29 $this->assertIsA($e, 'tsExceptionPackageImport', 'The usingpackage function didn\' throw the correct exception.');