| @@ 1695-1719 (lines=25) @@ | ||
| 1692 | * @group create |
|
| 1693 | * @group custom |
|
| 1694 | */ |
|
| 1695 | public function testCreateCustomUrlAliasBehaviour() |
|
| 1696 | { |
|
| 1697 | $handlerMock = $this->getPartlyMockedHandler(array('createUrlAlias')); |
|
| 1698 | ||
| 1699 | $handlerMock->expects( |
|
| 1700 | $this->once() |
|
| 1701 | )->method( |
|
| 1702 | 'createUrlAlias' |
|
| 1703 | )->with( |
|
| 1704 | $this->equalTo('eznode:1'), |
|
| 1705 | $this->equalTo('path'), |
|
| 1706 | $this->equalTo(false), |
|
| 1707 | $this->equalTo(null), |
|
| 1708 | $this->equalTo(false) |
|
| 1709 | )->will( |
|
| 1710 | $this->returnValue( |
|
| 1711 | new UrlAlias() |
|
| 1712 | ) |
|
| 1713 | ); |
|
| 1714 | ||
| 1715 | $this->assertInstanceOf( |
|
| 1716 | 'eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias', |
|
| 1717 | $handlerMock->createCustomUrlAlias(1, 'path') |
|
| 1718 | ); |
|
| 1719 | } |
|
| 1720 | ||
| 1721 | /** |
|
| 1722 | * Test for the createGlobalUrlAlias() method. |
|
| @@ 1728-1752 (lines=25) @@ | ||
| 1725 | * @group create |
|
| 1726 | * @group global |
|
| 1727 | */ |
|
| 1728 | public function testCreateGlobalUrlAliasBehaviour() |
|
| 1729 | { |
|
| 1730 | $handlerMock = $this->getPartlyMockedHandler(array('createUrlAlias')); |
|
| 1731 | ||
| 1732 | $handlerMock->expects( |
|
| 1733 | $this->once() |
|
| 1734 | )->method( |
|
| 1735 | 'createUrlAlias' |
|
| 1736 | )->with( |
|
| 1737 | $this->equalTo('module/module'), |
|
| 1738 | $this->equalTo('path'), |
|
| 1739 | $this->equalTo(false), |
|
| 1740 | $this->equalTo(null), |
|
| 1741 | $this->equalTo(false) |
|
| 1742 | )->will( |
|
| 1743 | $this->returnValue( |
|
| 1744 | new UrlAlias() |
|
| 1745 | ) |
|
| 1746 | ); |
|
| 1747 | ||
| 1748 | $this->assertInstanceOf( |
|
| 1749 | 'eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias', |
|
| 1750 | $handlerMock->createGlobalUrlAlias('module/module', 'path') |
|
| 1751 | ); |
|
| 1752 | } |
|
| 1753 | ||
| 1754 | /** |
|
| 1755 | * Test for the createUrlAlias() method. |
|