Permalink
Browse files

Merge pull request #530 from Hackwar/junit2

UT 2/10: Using realpath() in JLoaderTest to remove platform issues
  • Loading branch information...
2 parents 9218fd8 + 2e8b6b1 commit a886571df471953b64273f69a3b3e5f6353e6e00 @eddieajau eddieajau committed Nov 14, 2011
Showing with 21 additions and 14 deletions.
  1. +14 −14 tests/suite/JLoaderTest.php
  2. +7 −0 tests/suite/joomla/access/JAccessTest.php
@@ -157,14 +157,14 @@ public function testDiscover()
$classes = JLoader::getClassList();
$this->assertThat(
- $classes['challenger'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover1/challenger.php'),
+ realpath($classes['challenger']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover1/challenger.php')),
'Checks that the class path is correct (1).'
);
$this->assertThat(
- $classes['columbia'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover1/columbia.php'),
+ realpath($classes['columbia']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover1/columbia.php')),
'Checks that the class path is correct (2).'
);
@@ -178,23 +178,23 @@ public function testDiscover()
$classes = JLoader::getClassList();
$this->assertThat(
- $classes['shuttlechallenger'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover1/challenger.php'),
+ realpath($classes['shuttlechallenger']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover1/challenger.php')),
'Checks that the class path with prefix is correct (1).'
);
$this->assertThat(
- $classes['shuttlecolumbia'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover1/columbia.php'),
+ realpath($classes['shuttlecolumbia']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover1/columbia.php')),
'Checks that the class path with prefix is correct (2).'
);
JLoader::discover('Shuttle', JPATH_TESTS.'/suite/stubs/discover2', false);
$classes = JLoader::getClassList();
$this->assertThat(
- $classes['shuttlechallenger'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover1/challenger.php'),
+ realpath($classes['shuttlechallenger']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover1/challenger.php')),
'Checks that the original class paths are maintained when not forced.'
);
@@ -208,14 +208,14 @@ public function testDiscover()
$classes = JLoader::getClassList();
$this->assertThat(
- $classes['shuttlechallenger'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover2/challenger.php'),
+ realpath($classes['shuttlechallenger']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover2/challenger.php')),
'Checks that force overrides existing classes.'
);
$this->assertThat(
- $classes['shuttleatlantis'],
- $this->equalTo(JPATH_TESTS.'/suite/stubs/discover2/discover3/atlantis.php'),
+ realpath($classes['shuttleatlantis']),
+ $this->equalTo(realpath(JPATH_TESTS.'/suite/stubs/discover2/discover3/atlantis.php')),
'Checks that recurse works.'
);
}
@@ -394,6 +394,13 @@ public function testGetGroupsByUser()
$array2,
$this->equalTo($access->getGroupsByUser(42, False))
);
+
+ jimport('joomla.application.component.helper');
+
+ $this->assertThat(
+ $access->getGroupsByUser(null),
+ $this->equalTo(array(1))
+ );
}
/**

0 comments on commit a886571

Please sign in to comment.