Skip to content
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 model generator tests #70

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

KonstantinLapkovsky
Copy link

Issue #49

@KonstantinLapkovsky KonstantinLapkovsky self-assigned this Dec 20, 2023
@KonstantinLapkovsky KonstantinLapkovsky changed the base branch from master to 49-cover-entity-generator-with-tests December 20, 2023 19:15
@AZabolotnikov AZabolotnikov self-assigned this Nov 20, 2024
# Conflicts:
#	tests/ControllerGeneratorTest.php
#	tests/NovaResourceGeneratorTest.php
#	tests/NovaTestGeneratorTest.php
#	tests/Support/Controller/ControllerMockTrait.php
#	tests/Support/NovaResource/NovaResourceMockTrait.php
#	tests/Support/NovaTest/NovaTestMockTrait.php
#	tests/Support/Shared/GeneratorMockTrait.php
#	tests/TestCase.php
…erator-tests

# Conflicts:
#	tests/Support/Factory/FactoryMockTrait.php
Copy link
Collaborator

@DenTray DenTray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change target branch and merge it with the current master

@pirs1337 pirs1337 assigned pirs1337 and unassigned AZabolotnikov Dec 9, 2024
@pirs1337 pirs1337 changed the base branch from 49-cover-entity-generator-with-tests to master December 19, 2024 11:20
@pirs1337 pirs1337 assigned DenTray and unassigned pirs1337 Dec 19, 2024
@@ -60,8 +60,8 @@ public function prepareRelatedModels(): void
if (!$this->classExists('models', $relation)) {
$this->throwFailureException(
ClassNotExistsException::class,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add arg names for multiline style

]);
}

public function mockGeneratorForMissingRelationModel(): void
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems this method is not using

{
return $this->hasOne(Comment::class);
}
public function users()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check why no empty line between relations

{
return $this->hasMany(User::class);
}
protected $casts = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we change casts place after the hidden property

{
public function some_relation()
{

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@DenTray DenTray assigned pirs1337 and unassigned DenTray Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants