Longman\TelegramBot\Tests\Unit\Commands\CommandTest::testCommandConstructorNeedsTelegramObject PHP Method

testCommandConstructorNeedsTelegramObject() public method

Test idea from here: http://stackoverflow.com/a/4371606
    public function testCommandConstructorNeedsTelegramObject()
    {
        $exception_count = 0;
        $params_to_test = [[], [null], [12345], ['something'], [new \stdClass()], [$this->telegram]];
        foreach ($params_to_test as $param) {
            try {
                $this->getMockForAbstractClass($this->command_namespace, $param);
            } catch (\Exception $e) {
                $exception_count++;
            } catch (\Throwable $e) {
                //For PHP7
                $exception_count++;
            }
        }
        $this->assertEquals(5, $exception_count);
    }