diff options
Diffstat (limited to 'tests/lib/BackgroundJob/TestJob.php')
-rw-r--r-- | tests/lib/BackgroundJob/TestJob.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/lib/BackgroundJob/TestJob.php b/tests/lib/BackgroundJob/TestJob.php new file mode 100644 index 00000000000..a5ab4454550 --- /dev/null +++ b/tests/lib/BackgroundJob/TestJob.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\BackgroundJob; + + +class TestJob extends \OC\BackgroundJob\Job { + private $testCase; + + /** + * @var callable $callback + */ + private $callback; + + /** + * @param JobTest $testCase + * @param callable $callback + */ + public function __construct($testCase = null, $callback = null) { + $this->testCase = $testCase; + $this->callback = $callback; + } + + public function run($argument) { + $this->testCase->markRun(); + $callback = $this->callback; + $callback($argument); + } +} |