Skip to content

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

Closed
@SOHELAHMED7

Description

@SOHELAHMED7
/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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions