77use Contentstack \Test \REST ;
88use PHPUnit \Framework \TestCase ;
99use Contentstack \Support \Utility ;
10+ use Contentstack \Contentstack ;
1011
1112class EntriesTest extends TestCase {
1213 public static $ rest ;
@@ -18,7 +19,7 @@ class EntriesTest extends TestCase {
1819 */
1920 public static function setUpBeforeClass () : void {
2021 self ::$ rest = new REST ();
21- self ::$ Stack = Contentstack \Contentstack ::Stack (self ::$ rest ->getAPIKEY (), self ::$ rest ->getAccessToken (), self ::$ rest ->getEnvironmentName ());
22+ self ::$ Stack = Contentstack::Stack (self ::$ rest ->getAPIKEY (), self ::$ rest ->getAccessToken (), self ::$ rest ->getEnvironmentName ());
2223 if (self ::$ rest ->getHost () !== NULL ) {
2324 self ::$ Stack ->setHost (self ::$ rest ->getHost ());
2425 }
@@ -46,7 +47,7 @@ public function testFind() {
4647
4748 public function testFetch () {
4849 $ _entry = self ::$ Stack ->ContentType (CT_ContentType)->Entry (self ::$ _uid )->toJSON ()->fetch ();
49- print_r ( $ _entry [ ' title ' ]);
50+
5051 $ this ->assertEquals ($ _entry ['title ' ], 'CB1-10 ' );
5152 }
5253
@@ -134,7 +135,7 @@ public function testFindIncludeReferenceContentTypeUID() {
134135 $ _flag = "false " ;
135136 $ this ->assertArrayHasKey (0 , $ _entries );
136137 for ($ i = 0 ; $ i < count ($ _entries [0 ]); $ i ++) {
137- if ($ _entries [0 ][$ i ]["reference " ][0 ]['_content_type_uid ' ]) {
138+ if (count ( $ _entries [0 ][$ i ]["reference " ]) > 0 && $ _entries [0 ][$ i ][ " reference " ][ 0 ][ '_content_type_uid ' ] !== NULL ) {
138139 $ _flag = "true " ;
139140 }
140141 }
0 commit comments