12
12
namespace Gedmo \Tests \Translator ;
13
13
14
14
use Doctrine \Common \EventManager ;
15
- use Doctrine \Persistence \Proxy ;
16
15
use Gedmo \Tests \Tool \BaseTestCaseORM ;
17
16
use Gedmo \Tests \Translator \Fixture \Person ;
18
17
use Gedmo \Tests \Translator \Fixture \PersonCustom ;
@@ -114,7 +113,7 @@ public function testShouldTranslateRelation(): void
114
113
$ person = $ this ->em ->getRepository (Person::class)->findOneBy (['name ' => 'Jen ' ]);
115
114
static ::assertSame ('Женя ' , $ person ->translate ('ru ' )->getName ());
116
115
$ parent = $ person ->getParent ();
117
- static ::assertInstanceOf (Proxy::class, $ parent );
116
+ static ::assertTrue ( $ this -> em -> isUninitializedObject ( $ parent) );
118
117
static ::assertInstanceOf (Person::class, $ parent );
119
118
static ::assertSame ('Женя starshai ' , $ parent ->translate ('ru ' )->getName ());
120
119
static ::assertSame ('zenia ' , $ parent ->translate ('fr ' )->getName ());
@@ -133,7 +132,7 @@ public function testShouldHandleDomainObjectProxy(): void
133
132
$ this ->em ->clear ();
134
133
135
134
$ personProxy = $ this ->em ->getReference (Person::class, ['id ' => 1 ]);
136
- static ::assertInstanceOf (Proxy::class, $ personProxy );
135
+ static ::assertTrue ( $ this -> em -> isUninitializedObject ( $ personProxy) );
137
136
$ name = $ personProxy ->translate ('ru_RU ' )->getName ();
138
137
static ::assertSame ('Женя ' , $ name );
139
138
}
@@ -153,7 +152,7 @@ public function testTranslatableProxyWithUpperCaseProperty(): void
153
152
$ this ->em ->clear ();
154
153
155
154
$ personProxy = $ this ->em ->getReference (Person::class, ['id ' => 1 ]);
156
- static ::assertInstanceOf (Proxy::class, $ personProxy );
155
+ static ::assertTrue ( $ this -> em -> isUninitializedObject ( $ personProxy) );
157
156
$ name = $ personProxy ->translate ('ru_RU ' )->getName ();
158
157
static ::assertSame ('Женя ' , $ name );
159
158
$ lastName = $ personProxy ->translate ('ru_RU ' )->getLastName ();
0 commit comments