| @@ 1901-1925 (lines=25) @@ | ||
| 1898 | * @group create |
|
| 1899 | * @group custom |
|
| 1900 | */ |
|
| 1901 | public function testCreateCustomUrlAliasBehaviour() |
|
| 1902 | { |
|
| 1903 | $handlerMock = $this->getPartlyMockedHandler(array('createUrlAlias')); |
|
| 1904 | ||
| 1905 | $handlerMock->expects( |
|
| 1906 | $this->once() |
|
| 1907 | )->method( |
|
| 1908 | 'createUrlAlias' |
|
| 1909 | )->with( |
|
| 1910 | $this->equalTo('eznode:1'), |
|
| 1911 | $this->equalTo('path'), |
|
| 1912 | $this->equalTo(false), |
|
| 1913 | $this->equalTo(null), |
|
| 1914 | $this->equalTo(false) |
|
| 1915 | )->will( |
|
| 1916 | $this->returnValue( |
|
| 1917 | new UrlAlias() |
|
| 1918 | ) |
|
| 1919 | ); |
|
| 1920 | ||
| 1921 | $this->assertInstanceOf( |
|
| 1922 | 'eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias', |
|
| 1923 | $handlerMock->createCustomUrlAlias(1, 'path') |
|
| 1924 | ); |
|
| 1925 | } |
|
| 1926 | ||
| 1927 | /** |
|
| 1928 | * Test for the createGlobalUrlAlias() method. |
|
| @@ 1934-1958 (lines=25) @@ | ||
| 1931 | * @group create |
|
| 1932 | * @group global |
|
| 1933 | */ |
|
| 1934 | public function testCreateGlobalUrlAliasBehaviour() |
|
| 1935 | { |
|
| 1936 | $handlerMock = $this->getPartlyMockedHandler(array('createUrlAlias')); |
|
| 1937 | ||
| 1938 | $handlerMock->expects( |
|
| 1939 | $this->once() |
|
| 1940 | )->method( |
|
| 1941 | 'createUrlAlias' |
|
| 1942 | )->with( |
|
| 1943 | $this->equalTo('module/module'), |
|
| 1944 | $this->equalTo('path'), |
|
| 1945 | $this->equalTo(false), |
|
| 1946 | $this->equalTo(null), |
|
| 1947 | $this->equalTo(false) |
|
| 1948 | )->will( |
|
| 1949 | $this->returnValue( |
|
| 1950 | new UrlAlias() |
|
| 1951 | ) |
|
| 1952 | ); |
|
| 1953 | ||
| 1954 | $this->assertInstanceOf( |
|
| 1955 | 'eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias', |
|
| 1956 | $handlerMock->createGlobalUrlAlias('module/module', 'path') |
|
| 1957 | ); |
|
| 1958 | } |
|
| 1959 | ||
| 1960 | /** |
|
| 1961 | * Test for the createUrlAlias() method. |
|