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

Inverse relation must not be generated for self-referenced component schema #68

Closed
SOHELAHMED7 opened this issue Nov 13, 2024 · 0 comments · Fixed by #71
Closed

Inverse relation must not be generated for self-referenced component schema #68

SOHELAHMED7 opened this issue Nov 13, 2024 · 0 comments · Fixed by #71
Assignees
Labels
bug Something isn't working

Comments

@SOHELAHMED7
Copy link
Member

SOHELAHMED7 commented Nov 13, 2024

/app$ phpunit --filter '/IssueFixTest::test52BugDependentonAllofWithXFakerFalse$/'
PHPUnit 8.5.35 by Sebastian Bergmann and contributors.

F                                                                   1 / 1 (100%)

Time: 79 ms, Memory: 12.00 MB

There was 1 failure:

1) tests\unit\IssueFixTest::test52BugDependentonAllofWithXFakerFalse
Failed asserting that file contents of
/app/tests/tmp/docker_app/models/base/Invoice.php
are equal to file contents of
/app/tests/specs/issue_fix/52_bug_dependenton_allof_with_x_faker_false/mysql/models/base/Invoice.php 

 cp /app/tests/tmp/docker_app/models/base/Invoice.php /app/tests/specs/issue_fix/52_bug_dependenton_allof_with_x_faker_false/mysql/models/base/Invoice.php 

 
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
     {\n
         return $this->hasOne(\app\models\Animal::class, ['id' => 'animal_id']);\n
     }\n
+\n
+    public function getInvoice()\n
+    {\n
+        return $this->hasOne(\app\models\Invoice::class, ['reference_invoice_id' => 'id'])->inverseOf('reference_invoice');\n
+    }\n
+\n
+    public function getInvoice2()\n
+    {\n
+        return $this->hasOne(\app\models\Invoice::class, ['reference_invoice_2_id' => 'id'])->inverseOf('reference_invoice_2');\n
+    }\n
 }\n
 '

/app/tests/DbTestCase.php:130
/app/tests/unit/IssueFixTest.php:586
phpvfscomposer:///app/vendor/phpunit/phpunit/phpunit:97

FAILURES!
Tests: 1, Assertions: 22, Failures: 1.

Expected: this test should pass

Actual: this test fails as above


related to #26 and #25

@SOHELAHMED7 SOHELAHMED7 self-assigned this Nov 13, 2024
@SOHELAHMED7 SOHELAHMED7 added the bug Something isn't working label Nov 13, 2024
cebe added a commit that referenced this issue Dec 23, 2024
…be-generated-for-self-referenced-component-schema

Resolve: Inverse relation must not be generated for self-referenced component schema #68
@cebe cebe closed this as completed in #71 Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant