eZ\Publish\Core\Persistence\Legacy\Tests\Content\Type\ContentTypeHandlerTest::testCreateGroup PHP Method

testCreateGroup() public method

public testCreateGroup ( )
    public function testCreateGroup()
    {
        $createStruct = new GroupCreateStruct();
        $mapperMock = $this->getMapperMock();
        $mapperMock->expects($this->once())->method('createGroupFromCreateStruct')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Type\\Group\\CreateStruct'))->will($this->returnValue(new Group()));
        $gatewayMock = $this->getGatewayMock();
        $gatewayMock->expects($this->once())->method('insertGroup')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Type\\Group'))->will($this->returnValue(23));
        $handler = $this->getHandler();
        $group = $handler->createGroup(new GroupCreateStruct());
        $this->assertInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Type\\Group', $group);
        $this->assertEquals(23, $group->id);
    }