| @@ 1920-1944 (lines=25) @@ | ||
| 1917 | * @group create |
|
| 1918 | * @group custom |
|
| 1919 | */ |
|
| 1920 | public function testCreateCustomUrlAliasBehaviour() |
|
| 1921 | { |
|
| 1922 | $handlerMock = $this->getPartlyMockedHandler(['createUrlAlias']); |
|
| 1923 | ||
| 1924 | $handlerMock->expects( |
|
| 1925 | $this->once() |
|
| 1926 | )->method( |
|
| 1927 | 'createUrlAlias' |
|
| 1928 | )->with( |
|
| 1929 | $this->equalTo('eznode:1'), |
|
| 1930 | $this->equalTo('path'), |
|
| 1931 | $this->equalTo(false), |
|
| 1932 | $this->equalTo(null), |
|
| 1933 | $this->equalTo(false) |
|
| 1934 | )->will( |
|
| 1935 | $this->returnValue( |
|
| 1936 | new UrlAlias() |
|
| 1937 | ) |
|
| 1938 | ); |
|
| 1939 | ||
| 1940 | $this->assertInstanceOf( |
|
| 1941 | UrlAlias::class, |
|
| 1942 | $handlerMock->createCustomUrlAlias(1, 'path') |
|
| 1943 | ); |
|
| 1944 | } |
|
| 1945 | ||
| 1946 | /** |
|
| 1947 | * Test for the createGlobalUrlAlias() method. |
|
| @@ 1953-1977 (lines=25) @@ | ||
| 1950 | * @group create |
|
| 1951 | * @group global |
|
| 1952 | */ |
|
| 1953 | public function testCreateGlobalUrlAliasBehaviour() |
|
| 1954 | { |
|
| 1955 | $handlerMock = $this->getPartlyMockedHandler(['createUrlAlias']); |
|
| 1956 | ||
| 1957 | $handlerMock->expects( |
|
| 1958 | $this->once() |
|
| 1959 | )->method( |
|
| 1960 | 'createUrlAlias' |
|
| 1961 | )->with( |
|
| 1962 | $this->equalTo('module/module'), |
|
| 1963 | $this->equalTo('path'), |
|
| 1964 | $this->equalTo(false), |
|
| 1965 | $this->equalTo(null), |
|
| 1966 | $this->equalTo(false) |
|
| 1967 | )->will( |
|
| 1968 | $this->returnValue( |
|
| 1969 | new UrlAlias() |
|
| 1970 | ) |
|
| 1971 | ); |
|
| 1972 | ||
| 1973 | $this->assertInstanceOf( |
|
| 1974 | UrlAlias::class, |
|
| 1975 | $handlerMock->createGlobalUrlAlias('module/module', 'path') |
|
| 1976 | ); |
|
| 1977 | } |
|
| 1978 | ||
| 1979 | /** |
|
| 1980 | * Test for the createUrlAlias() method. |
|