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:----h7kJ6xTNLYQ3PNI2orvg+SS/w981Ikbzi6dtTTQXE32ZoX/Qe7Zs62b9D08qFG3DiqyoP9KeMWTMoTy4Hn1l7zpJU1a8nosTPDKdPzBk8IGvtrl6RPguVNCscyzEM2I/HoTqGtLkokJVqlbJjq49lkumVZsnoYB+YdRFd214KsgKHzUnJ5I4i1dQmItSPX8jMiajiyDpx/lcjwUeoXXpEeA2Y2KjjlIliPHchqHSNRQ0b9OWrPGEwPRK7jN6l9LyXwqeiA0ZcS+rj6d0v03t3hvdogJ14HuaJgmnDar/yaGgYiuRAKAdqkNy52wUDMbD0IFGzWrY55T9gI2rCbarFPyq0eDV2s7TJBDFVkpr0NeA4gF3iWYxMurDS3wzrwr/7ZIhp4RAHJAlp8n3paRs3kZdR/I6h7c8yN9Oi8QaNgPordlewkx43BcC4f/pS4rLCwiIThkomkMSll35jaEy1FIAvRiAJ2xP3fByNYsI/Qp86MULzcr4p4F4V6hJHc/fam4zSH5/wt3YnTUxL+3ymAIiRkVaPrifeYNmDutd+JKTdriBvG3/MnJzjaczifOFl2dfZG9ax3NIpK8zDDWOZJEZ4Gz8sJWW3XFwVI46a0RawOB6BMXKBpd4eu46rYu6qS30GY2tn+Vr7oQwxU5CZbDrXEpnu9EjGS7oYShxb/A=----ATTACHMENT:----Mzc4MzYwMTQ3MjY5MTgwIDg4NTE3Njk5NjQzODk3NjQgNjg3MzgzMTk4NzY3MTMy