1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace Test\BackgroundJob;
- use OCP\AppFramework\Utility\ITimeFactory;
- class TestJob extends \OCP\BackgroundJob\Job {
- private $testCase;
-
- private $callback;
-
- public function __construct(?ITimeFactory $time = null, $testCase = null, $callback = null) {
- parent::__construct($time ?? \OCP\Server::get(ITimeFactory::class));
- $this->testCase = $testCase;
- $this->callback = $callback;
- }
- public function run($argument) {
- $this->testCase->markRun();
- $callback = $this->callback;
- $callback($argument);
- }
- }
|