SensioLabs\Insight\Sdk\Tests\ApiTest::testCreateProjectNOk PHP Method

testCreateProjectNOk() public method

    public function testCreateProjectNOk()
    {
        $project = new Project();
        $this->pluginMockResponse->addResponse($this->createResponse('errors', 400));
        try {
            $project = $this->api->createProject($project);
            $this->fail('Something should go wrong');
        } catch (\Exception $e) {
            $this->assertInstanceOf('SensioLabs\\Insight\\Sdk\\Exception\\ApiClientException', $e);
            $this->assertSame('Your request in not valid (status code: "400", reason phrase: "Bad Request").See $error attached to the exception', $e->getMessage());
            $this->assertInstanceOf('SensioLabs\\Insight\\Sdk\\Model\\Error', $e->getError());
        }
    }