From 65aa2ec826add8fdc4eaa43c51b0c4b7cc6854cc Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Mon, 2 Dec 2024 13:19:42 +0100 Subject: [PATCH] Delete LinkUpdater.test.php --- source/php/LinkUpdater/LinkUpdater.test.php | 114 -------------------- 1 file changed, 114 deletions(-) delete mode 100644 source/php/LinkUpdater/LinkUpdater.test.php diff --git a/source/php/LinkUpdater/LinkUpdater.test.php b/source/php/LinkUpdater/LinkUpdater.test.php deleted file mode 100644 index 13ba14c..0000000 --- a/source/php/LinkUpdater/LinkUpdater.test.php +++ /dev/null @@ -1,114 +0,0 @@ - $input, - 'getOption' => 'option' - ]); - $acfService = new FakeAcfService([]); - - $config = new Config( - $wpService, - $acfService, - 'filter-prefix', - 'plugin-path', - 'plugin-url' - ); - - $postId = 123; - - $linkUpdater = new LinkUpdater( - $wpService, - $config, - new Database( - $config, - $wpService - ) - ); - - // Act - $result = $linkUpdater->createPermalink($postId, $postName); - - // Assert - $this->assertEquals($expected, $result); - } - - /** - * Test urls. - */ - public function testThatLinkHasChangedDetectsLinksThatChanges() - { - // Arrange - $wpService = new FakeWpService([ - 'getPermalink' => 'https://example.com/old-permalink/', - 'getOption' => 'option', - 'applyFilters' => function($filter, $value) { - return $value; - } - ]); - - $acfService = new FakeAcfService([]); - - $config = new Config( - $wpService, - $acfService, - 'filter-prefix', - 'plugin-path', - 'plugin-url' - ); - - $linkUpdater = new LinkUpdater( - $wpService, - $config, - new Database( - $config, - $wpService - ) - ); - - $data = [ - 'post_name' => 'sample-post', - 'post_type' => 'post' - ]; - - $post = [ - 'ID' => 123, - 'post_name' => 'old-post', - 'post_type' => 'post' - ]; - - $result = $linkUpdater->linkHasChanged($data, $post); - - // Assert - $this->assertTrue($result); - } - - /** - * Test urls. - */ - private function uriProvider() - { - return [ - ['https://example.com/old-permalink/', 'https://example.com/sample-post', 'sample-post'], - ['https://example.com/old-permalink', 'https://example.com/sample-post', 'sample-post'], - ['https://example.com/old-permalink/with/multiple/subs', 'https://example.com/old-permalink/with/multiple/sample-post', 'sample-post'] - ]; - } -} \ No newline at end of file