tests/CmsManager/CmsPageManagerTest.php
/**
     * Test get Page method with url throw Exception.
     */
Test get Page method with url throw Exception.
Test get Page method with url throw Exception .
public function testGetPageWithIdException(): void
    {
        $this->expectException(PageNotFoundException::class);
        $this->expectExceptionMessage('Unable to find the page : id = 1');
        $pageManager = $this->createMock(PageManagerInterface::class);
        $this->blockInteractor->method('loadPageBlocks')->willReturn([]);
        $manager = $this->createManager($pageManager, $this->blockInteractor);
        $page = 1;
        $site = new Site();
        $pageManager->method('findOneBy')->willReturn(null);
        $manager = $this->createManager($pageManager, $this->blockInteractor);
        $manager->getPage($site, $page);
    }
public function testGetPageWithIdException ( ) : void { $ this -> expectException ( PageNotFoundException :: class ) ; $ this -> expectExceptionMessage ( 'Unable to find the page : id = 1' ) ; $ pageManager = $ this -> createMock ( PageManagerInterface :: class ) ; $ this -> blockInteractor -> method ( 'loadPageBlocks' ) -> willReturn ( [ ] ) ; $ manager = $ this -> createManager ( $ pageManager , $ this -> blockInteractor ) ; $ page = 1 ; $ site = new Site ( ) ; $ pageManager -> method ( 'findOneBy' ) -> willReturn ( null ) ; $ manager = $ this -> createManager ( $ pageManager , $ this -> blockInteractor ) ; $ manager -> getPage ( $ site , $ page ) ; }
Test get Page method with url throw Exception.
Test get Page method with url throw Exception .