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

Add missing tables and test for model table existence #2953

Merged
merged 11 commits into from Apr 12, 2018

Conversation

2 participants
@notbakaneko
Contributor

notbakaneko commented Apr 10, 2018

No description provided.

@notbakaneko notbakaneko added the WIP label Apr 10, 2018

notbakaneko added some commits Apr 10, 2018

set collation;
otherwise laravel will try incompatible defaults :D

@notbakaneko notbakaneko removed the WIP label Apr 10, 2018

@notbakaneko notbakaneko changed the title from Add test for model table existence to Add missing tables and test for model table existence Apr 10, 2018

private function checkDir(string $basePath, string $namespace = '')
{
$errors = [];
$entries = scandir($basePath);

This comment has been minimized.

@nanaya

nanaya Apr 10, 2018

Collaborator

There's this File::allFiles().

$errors = $this->checkDir($this->modelsPath);
// prints a diff with the classes that errored.
$this->assertEquals([], $errors);

This comment has been minimized.

@nanaya

nanaya Apr 10, 2018

Collaborator

Probably should use assertSame.

Use symfony/finder.
Might as well since it's already a dependency of other packages
{
$errors = [];
$files = (new Finder)->in(app_path().'/Models')->files();

This comment has been minimized.

@nanaya

nanaya Apr 12, 2018

Collaborator

Why don't just use the File thingy from laravel? ?_?

This comment has been minimized.

@notbakaneko

notbakaneko Apr 12, 2018

Contributor

It's a wrapper around Finder anyway ┐(ツ)┌

@@ -37,6 +37,7 @@
"paypal/rest-api-sdk-php": "*",
"predis/predis": "~1.0",
"sentry/sentry-laravel": "*",
"symfony/finder": "*",

This comment has been minimized.

@nanaya

nanaya Apr 12, 2018

Collaborator

this probably isn't needed. If laravel changes the return, it'll explode in different way anyway and this wouldn't help ┐(°~° )┌

@nanaya

nanaya approved these changes Apr 12, 2018

@nanaya nanaya merged commit dc5782d into ppy:master Apr 12, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@notbakaneko notbakaneko deleted the notbakaneko:feature/test-table-existence branch Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment