diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-16 09:44:49 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-16 09:44:49 +0100 |
commit | 20553c1afe035b2e020409fd516d0288b748dc7f (patch) | |
tree | 9b7cc32ee2560d86315339b9716c1a790a680afc /3rdparty/simpletest/test/collector_test.php | |
parent | 19827b8b35de6192d54bf7600e9e29800c93b21b (diff) | |
download | nextcloud-server-20553c1afe035b2e020409fd516d0288b748dc7f.tar.gz nextcloud-server-20553c1afe035b2e020409fd516d0288b748dc7f.zip |
Revert "remove the 3rdparty files. everything is now in https://gitorious.org/owncloud/3rdparty"
This reverts commit dccdeca2581f705c69eb4266aa646173f588a9de.
Diffstat (limited to '3rdparty/simpletest/test/collector_test.php')
-rwxr-xr-x | 3rdparty/simpletest/test/collector_test.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/3rdparty/simpletest/test/collector_test.php b/3rdparty/simpletest/test/collector_test.php new file mode 100755 index 00000000000..efdbf377ece --- /dev/null +++ b/3rdparty/simpletest/test/collector_test.php @@ -0,0 +1,50 @@ +<?php +// $Id: collector_test.php 1769 2008-04-19 14:39:00Z pp11 $ +require_once(dirname(__FILE__) . '/../autorun.php'); +require_once(dirname(__FILE__) . '/../collector.php'); +SimpleTest::ignore('MockTestSuite'); +Mock::generate('TestSuite'); + +class PathEqualExpectation extends EqualExpectation { + function __construct($value, $message = '%s') { + parent::__construct(str_replace("\\", '/', $value), $message); + } + + function test($compare) { + return parent::test(str_replace("\\", '/', $compare)); + } +} + +class TestOfCollector extends UnitTestCase { + function testCollectionIsAddedToGroup() { + $suite = new MockTestSuite(); + $suite->expectMinimumCallCount('addFile', 2); + $suite->expect( + 'addFile', + array(new PatternExpectation('/collectable\\.(1|2)$/'))); + $collector = new SimpleCollector(); + $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); + } +} + +class TestOfPatternCollector extends UnitTestCase { + + function testAddingEverythingToGroup() { + $suite = new MockTestSuite(); + $suite->expectCallCount('addFile', 2); + $suite->expect( + 'addFile', + array(new PatternExpectation('/collectable\\.(1|2)$/'))); + $collector = new SimplePatternCollector('/.*/'); + $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); + } + + function testOnlyMatchedFilesAreAddedToGroup() { + $suite = new MockTestSuite(); + $suite->expectOnce('addFile', array(new PathEqualExpectation( + dirname(__FILE__) . '/support/collector/collectable.1'))); + $collector = new SimplePatternCollector('/1$/'); + $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); + } +} +?>
\ No newline at end of file |