-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix CI #12
Fix CI #12
Conversation
"test": "phpunit", | ||
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.9.0 psalm/phar:~5.4.0 && mv composer.backup composer.json", | ||
"stan-setup": "phive install", |
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.
I've introduced the phive toolset which we also use in the core.
See https://github.com/cakephp/cakephp/blob/5.x/.github/CONTRIBUTING.md#test-cases-codesniffer-and-static-analysis to learn more about it
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
$loader = new SchemaLoader(); | ||
$loader->loadInternalFile(env('FIXTURE_SCHEMA_METADATA'), 'test'); | ||
} | ||
require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php'; |
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.
If this plugin doesn't need a custom test bootstrapping process, then just requiring the core one is fine
@@ -313,7 +315,7 @@ public function copyToWebroot(?string $filename = null, string $path = 'files', | |||
|
|||
$prefix = null; | |||
if (empty($config['no_prefix'])) { | |||
$prefix = Strings::substring(md5($this->modified->toDateTimeString()), 0, 3) . '-'; | |||
$prefix = Strings::substring(md5($this->modified?->toDateTimeString() ?? ''), 0, 3) . '-'; |
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.
this should be looked into.
As said in another issue modified
shouldn't be nullable in the first place.
@@ -122,7 +127,7 @@ public function download(string $id): Response | |||
}); | |||
|
|||
$response = $this->getResponse() | |||
->withType($asset->mimetype) | |||
->withType($asset->mimetype ?? 'jpg') |
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.
What if the asset doesn't have a mime type? Currently $asset->mimetype
is nullable.
{ | ||
parent::setUp(); | ||
if (!defined('PLUGIN_ROOT')) { | ||
include __DIR__ . DS . '..' . DS . 'bootstrap.php'; |
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.
I can't run tests from the phpstorm sidebar without this as the bootstrap script seems not to be run then.
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.
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.
Thank you so much! Tests work for me locally when running with composer, but not through the phpstorm sidebar.. Should be due to the bootstrap.php not being loaded automatically although it being defined in the phpunit config file. Also thanl you for fixing types and code style. Regarding the nullable fields: This would require a migration so I wanted to wait until I might release some further db changes.. |
Was released in version 0.5.1 |
Refs: #11