DataSift\Storyplayer\CommandLib\CommandRunnerTest::testCommandMustBeAString PHP Метод

testCommandMustBeAString() публичный Метод

    public function testCommandMustBeAString()
    {
        // ----------------------------------------------------------------
        // setup your test
        // our test subject
        $obj = new CommandRunner();
        // our mocked $st
        $st = Mockery::mock("DataSift\\Storyplayer\\PlayerLib\\StoryTeller");
        // a list of invalid commands to try
        $helperCmds = [1, 5.9, null, ['fred'], (object) ['fred' => 'harry']];
        // ----------------------------------------------------------------
        // perform the change
        foreach ($helperCmds as $helperCmd) {
            try {
                $caughtException = false;
                $obj->runSilently($st, $helperCmd);
            } catch (Exception $e) {
                $caughtException = true;
            }
            $this->assertTrue($caughtException);
        }
    }