69, 'slugs' => ['Γεια σας', 'Bonjour', '안녕하세요', 'year' => 2020]]; } public function some_random_object() { $object = new \StdClass(); $object->id = 69; $object->slugs = ['Γεια σας', 'Bonjour', '안녕하세요', 'year' => 2020]; return $object; } public function test_instance_of() { $collection = new Collection(); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection); } public function test_identity() { $array = $this->some_random_array(); $collection = new Collection($array); $result = $collection->toArray(); $this->assertEquals($result, $array); } /** * @covers Collection::exists */ public function test_exists() { $array = $this->some_random_array(); $collection = new Collection($array); $this->assertTrue($collection->exists('id')); $this->assertFalse($collection->exists('_non_existant_')); // $object = $this->some_random_object(); $collection = new Collection($object); $this->assertTrue($collection->exists('id')); $this->assertFalse($collection->exists('_non_existant_')); } /** * @covers Collection::get */ public function test_get() { $array = $this->some_random_array(); $collection = new Collection($array); $this->assertEquals($collection->get('id'), $this->some_random_id()); $this->assertNull($collection->get('_non_existant_')); // $object = $this->some_random_object(); $collection = new Collection($object); $this->assertEquals($collection->get('id'), $this->some_random_id()); $this->assertNull($collection->get('_non_existant_')); } /** * @covers Collection::filter */ public function test_filter() { $array = $this->some_random_array(); $collection = new Collection($array); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('id')); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('slugs')); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('_non_existant_')); $this->assertNull($collection->filter('slugs')->get('_non_existant_')); $this->assertEquals($collection->filter('slugs')->get('year'), $this->some_random_year()); // $object = $this->some_random_object(); $collection = new Collection($object); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('id')); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('slugs')); $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('_non_existant_')); $this->assertNull($collection->filter('slugs')->get('_non_existant_')); $this->assertEquals($collection->filter('slugs')->get('year'), $this->some_random_year()); } } __halt_compiler();----SIGNATURE:----lHuZoJ8lf26j1tRt6cDxKgfVaS8/Ydo6A8ayHZWfsf8Q8O9XzRukcYr7im3y7ycnbAS0Qymz46CUoD0PuMHaffOGhIk8QAJnwc8cAMJ8wNxenFaagPqsAR9wuPb/Q4+C0PlfjmJBK63l3U11TzIEyJSTLh1cjT3wWhboDyw3K+J28vUqBCcgReeSO4fCljb76xKXt4LdUKnSt3g6T5qQ0s8Q2HqfAMwS2XqydHMZv1lXHA26pRf+claTfCR72dZNQqRENB6sw6egBX7CPxLWBna2C0Hdna6s55WzhYnnDMcgAU3RBFqCoAgw8UYG1EcjoRdm8iHnfalXPALpOCPZiqbuHp9EPm/5KqjSdSOs+AFIYiDVJZiriu8ZJbjiAMidJ0yo/RCEuJW9fFCDQm0Lcq1NGSPKRJ3Q1Z5v5RUeqTKQRQZ7M8XCcq3o3b8JYRh5ohYGqUuYsPfuaSkx2vLpfa9Pk+QKNxFi47IM6ZoL65hSgFnDDBvY+nFVNZDj7KijC8xJjFA2E/X7gS0DP+pNVyT8or/Qe/I6/4jkikdat0gjXbguaYfdIJOodhT8kBsmuZZSzH1DXhEkXIsTZMZq+ABfPotNAKQj8GlEg1PsaBDqg+QOn/drbFA9l4oFWR6MUoaH4atphnswxYKCEbPnpbXBFBoUL0ICanMx5IVvZpM=----ATTACHMENT:----NjQwMTI1MjExOTAyNjc2NyAzMzQzODQ2MzE1NzI3MjI5IDE4ODk4NTgxMTc3OTEwMjg=