/** * @test */ public function testChatType() { $this->chat = new Chat(json_decode('{"id":123,"title":null,"first_name":"john","last_name":null,"username":"******"}', true)); $this->assertEquals('private', $this->chat->getType()); $this->chat = new Chat(json_decode('{"id":-123,"title":"ChatTitle","first_name":null,"last_name":null,"username":"******"}', true)); $this->assertEquals('group', $this->chat->getType()); $this->chat = new Chat(json_decode('{"id":-123,"type":"channel","title":"ChatTitle","first_name":null,"last_name":null,"username":"******"}', true)); $this->assertEquals('channel', $this->chat->getType()); }