eZ\Bundle\EzPublishRestBundle\Tests\Functional\UserTest::testCreateSession PHP 메소드

testCreateSession() 공개 메소드

public testCreateSession ( ) : string
리턴 string The created session href
    public function testCreateSession()
    {
        self::markTestSkipped('@todo fixme');
        $text = $this->addTestSuffix('testCreateUser');
        $xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<SessionInput>
  <login>{$text}</login>
  <password>{$text}</password>
</SessionInput>
XML;
        $request = $this->createHttpRequest('POST', '/api/ezp/v2/user/sessions', 'SessionInput+xml', 'Session+json');
        $request->setContent($xml);
        $response = $this->sendHttpRequest($request);
        self::assertHttpResponseCodeEquals($response, 201);
        self::assertHttpResponseHasHeader($response, 'Location');
        $href = $response->getHeader('Location');
        $this->addCreatedElement($href);
        return $href;
    }