PartKeepr\AuthBundle\Tests\UserTest::testCreateUser PHP Method

testCreateUser() public method

public testCreateUser ( )
    public function testCreateUser()
    {
        $client = static::makeClient(true);
        $data = ['username' => 'foobartest', 'newPassword' => '1234'];
        $client->request('POST', '/api/users', [], [], [], json_encode($data));
        $response = json_decode($client->getResponse()->getContent());
        $this->assertEquals(201, $client->getResponse()->getStatusCode());
        $this->assertEquals('foobartest', $response->{'username'});
        $this->assertEmpty($response->{'password'});
        $this->assertEmpty($response->{'newPassword'});
        $this->assertFalse($response->{'legacy'});
    }