Bolt\Tests\Controller\Async\StackTest::testAddStack PHP Method

testAddStack() public method

public testAddStack ( )
    public function testAddStack()
    {
        $this->setSessionUser(new Entity\Users($this->getService('users')->getUser('admin')));
        $request = Request::create('/async/stack/add', 'POST', ['filename' => 'foo.txt']);
        $response = $this->controller()->add($request);
        $this->assertTrue($response instanceof JsonResponse);
        $json = json_decode($response->getContent(), true);
        $this->assertNull($json['removed']);
        $this->assertContains('<div class="stackitem', $json['panel']);
        $this->assertContains('<li', $json['list']);
    }