eZ\Publish\Core\Persistence\Legacy\Tests\Content\Section\SectionHandlerTest::testCreate PHP Method

testCreate() public method

public testCreate ( )
    public function testCreate()
    {
        $handler = $this->getSectionHandler();
        $gatewayMock = $this->getGatewayMock();
        $gatewayMock->expects($this->once())->method('insertSection')->with($this->equalTo('New Section'), $this->equalTo('new_section'))->will($this->returnValue(23));
        $sectionRef = new Section();
        $sectionRef->id = 23;
        $sectionRef->name = 'New Section';
        $sectionRef->identifier = 'new_section';
        $result = $handler->create('New Section', 'new_section');
        $this->assertEquals($sectionRef, $result);
    }