From 538165e3ff7b7b3f27ae9654ed95bd2b78f8c7a0 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 10 Jun 2014 10:47:05 +0200 Subject: [PATCH] Moved job context management to interface --- src/Api/Jobs/AbstractJob.php | 4 ---- src/Api/Jobs/IJob.php | 7 +++++++ src/Api/Jobs/PostJobs/AddPostJob.php | 2 +- tests/Tests/ApiTests/ApiPrivilegeTest.php | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Api/Jobs/AbstractJob.php b/src/Api/Jobs/AbstractJob.php index bd2ebafb..1f65638b 100644 --- a/src/Api/Jobs/AbstractJob.php +++ b/src/Api/Jobs/AbstractJob.php @@ -1,10 +1,6 @@ getSubJobs() as $subJob) { - $subJob->setContext(AbstractJob::CONTEXT_BATCH_ADD); + $subJob->setContext(self::CONTEXT_BATCH_ADD); try { Api::run($subJob, $arguments); diff --git a/tests/Tests/ApiTests/ApiPrivilegeTest.php b/tests/Tests/ApiTests/ApiPrivilegeTest.php index 62097dfd..b58094b9 100644 --- a/tests/Tests/ApiTests/ApiPrivilegeTest.php +++ b/tests/Tests/ApiTests/ApiPrivilegeTest.php @@ -53,7 +53,7 @@ class ApiPrivilegeTest extends AbstractFullApiTest $ctx = function($job) { - $job->setContext(AbstractJob::CONTEXT_BATCH_ADD); + $job->setContext(IJob::CONTEXT_BATCH_ADD); return $job; }; $this->testDynamicPostPrivilege($ctx(new EditPostContentJob), Privilege::AddPostContent); @@ -139,7 +139,7 @@ class ApiPrivilegeTest extends AbstractFullApiTest $ctx = function($job) { - $job->setContext(AbstractJob::CONTEXT_BATCH_ADD); + $job->setContext(IJob::CONTEXT_BATCH_ADD); return $job; }; $this->testDynamicUserPrivilege($ctx(new EditUserAccessRankJob()), Privilege::EditUserAccessRank);