-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkp/pkp-lib#10306 unit tests for queue jobs #10340
base: main
Are you sure you want to change the base?
Changes from all commits
6c4b2cb
e3cb6a7
bfd4b68
38ea071
9b3c8b7
9d195fb
f1aa20b
cbb858d
d4a5b86
25261f6
2cad824
c82b9ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,11 @@ | |
|
||
class PKPContainer extends Container | ||
{ | ||
/** | ||
* Define if the app currently runing the unit test | ||
*/ | ||
private bool $isRunningUnitTest = false; | ||
|
||
/** | ||
* The base path of the application, needed for base_path helper | ||
*/ | ||
|
@@ -538,15 +543,6 @@ protected function settingProxyForStreamContext(): void | |
libxml_set_streams_context($context); | ||
} | ||
|
||
/** | ||
* Override Laravel method; always false. | ||
* Prevents the undefined method error when the Log Manager tries to determine the driver | ||
*/ | ||
public function runningUnitTests(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Determine if the application is currently down for maintenance. | ||
*/ | ||
|
@@ -590,6 +586,31 @@ public function environment(string ...$environments): string|bool | |
|
||
return $this->get('config')['app']['env']; | ||
} | ||
|
||
/** | ||
* Override Laravel method; always false. | ||
* Prevents the undefined method error when the Log Manager tries to determine the driver | ||
*/ | ||
public function runningUnitTests(): bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be removed once we add and configure the Laravel logging service provider, correct? I think this is related to what you're talking about with Erik. It might be worth filing in Github, noting this function in the issue, and adding a FIXME here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not exactly , this has there before this PR and probably will stay . Our Container class extends the laravel core container but We have our very own Application class . Once we able to handle the bootstrapping process to Laravel's foundation Application, we can remove this (as it's reside there) . As few core class required this information, so we have copied it from Laravel's foundation application class to our PKPContainer just to facilitate the dependency. |
||
{ | ||
return $this->isRunningUnitTest; | ||
} | ||
|
||
/** | ||
* Set the app running unit test | ||
*/ | ||
public function setRunningUnitTests(): void | ||
{ | ||
$this->isRunningUnitTest = true; | ||
} | ||
|
||
/** | ||
* Unset the app running unit test | ||
*/ | ||
public function unsetRunningUnitTests(): void | ||
{ | ||
$this->isRunningUnitTest = false; | ||
} | ||
} | ||
|
||
if (!PKP_STRICT_MODE) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of functionality to mocking ability for guzzel request .