diff --git a/Core/Contents/Test/Case/Model/Behavior/TaggableBehaviorTest.php b/Core/Contents/Test/Case/Model/Behavior/TaggableBehaviorTest.php index aa5090703..015567778 100644 --- a/Core/Contents/Test/Case/Model/Behavior/TaggableBehaviorTest.php +++ b/Core/Contents/Test/Case/Model/Behavior/TaggableBehaviorTest.php @@ -54,7 +54,7 @@ class TaggableBehaviorTest extends CakeTestCase { 'plugin.installer.plugin', 'plugin.contents.global_tagged', 'plugin.contents.global_tag', - 'plugin.contents.article' + 'plugin.contents.content_article' ); /** diff --git a/Core/Contents/Test/Fixture/ArticleFixture.php b/Core/Contents/Test/Fixture/ContentArticleFixture.php similarity index 86% rename from Core/Contents/Test/Fixture/ArticleFixture.php rename to Core/Contents/Test/Fixture/ContentArticleFixture.php index 32661e8e2..5e89f5b26 100755 --- a/Core/Contents/Test/Fixture/ArticleFixture.php +++ b/Core/Contents/Test/Fixture/ContentArticleFixture.php @@ -22,7 +22,7 @@ * @subpackage plugins.tags.tests.fixtures */ -class ArticleFixture extends CakeTestFixture { +class ContentArticleFixture extends CakeTestFixture { public $table = 'articles'; /** * fields property @@ -32,7 +32,8 @@ class ArticleFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer'), - 'title' => array('type' => 'string', 'null' => false)); + 'title' => array('type' => 'string', 'null' => false) + ); /** * records property @@ -49,7 +50,8 @@ class ArticleFixture extends CakeTestFixture { 'title' => 'Second Article'), array( 'id' => 3, - 'title' => 'Third Article')); + 'title' => 'Third Article') + ); } ?> \ No newline at end of file diff --git a/Core/Events/Test/Case/GlobalEventsTest.php b/Core/Events/Test/Case/EventsLayerTest.php similarity index 92% rename from Core/Events/Test/Case/GlobalEventsTest.php rename to Core/Events/Test/Case/EventsLayerTest.php index d67456498..8f5888166 100644 --- a/Core/Events/Test/Case/GlobalEventsTest.php +++ b/Core/Events/Test/Case/EventsLayerTest.php @@ -1,5 +1,5 @@ assertEqual($plugins, $this->Plugin->getAllPlugins()); + $this->assertEqual($plugins, $this->Plugin->getAllPlugins('list')); + $this->assertEqual($plugins, $this->Plugin->getAllPlugins('whatever')); + + $this->assertEqual(count(App::objects('plugin')), $this->Plugin->getAllPlugins('count')); + } + +/** + * @test getting installed plugins + */ + public function testGetInstalledPlugins() { + $this->disableBehavior('Trashable'); + + $expected = array( + '4cdc2083-430c-42f1-be78-235e6318cd70' => 'Backlinks', + '4ce009fa-a76c-49f4-a488-120b6318cd70' => 'Blog', + '4c94edcb-4468-4d97-87ad-78d86318cd70' => 'Categories', + '4e286dc3-4454-4526-af0a-18876318cd70' => 'Charts', + '4e286eaa-0364-49b2-b6f2-18876318cd70' => 'ClearCache', + '4ce00a63-4e10-4cf2-b8d8-120b6318cd70' => 'Cms', + '4c94edcb-9624-4ce3-acfe-78d86318cd70' => 'Comments', + '4ce2a40a-5d8c-4157-b39e-133c6318cd70' => 'Configs', + '4c94edcc-4ec0-4c4e-97de-78d86318cd70' => 'Contact', + '4ce2a9b1-d348-4200-8828-15fb6318cd70' => 'Contents', + '4cfe3fcf-600c-4ae2-b655-1bbd6318cd70' => 'Crons', + '4c94edcc-ac70-474f-a4a3-78d86318cd70' => 'Data', + '4cdc2397-f870-4615-ae65-247a6318cd70' => 'DebugKit', + '4e286f53-c380-4930-8c94-18876318cd70' => 'Dev', + '4cbc4e7e-b798-4aad-bc22-16836318cd70' => 'Emails', + '4c94edcc-9b50-49e6-9af3-78d86318cd70' => 'Events', + '4e286fd1-2a3c-4775-9a87-18876318cd70' => 'Facebook', + '4cbc74a9-8fe8-43da-aaa4-20786318cd70' => 'Feed', + '4c94edcc-aa7c-4509-9c18-78d86318cd70' => 'Filemanager', + '4c94edcc-84ec-47c9-963d-78d86318cd70' => 'Filter', + '4cdc264b-9d50-42b4-834b-2a206318cd70' => 'Gallery', + '4e2871cd-90c0-431c-9eee-18876318cd70' => 'Geshi', + '4c94edcb-3394-4e47-ad23-78d86318cd70' => 'Google', + '4c94edcc-e084-44d8-bce8-78d86318cd70' => 'Installer', + '4c94edcd-a188-49bb-8a08-78d86318cd70' => 'Libs', + '4c94edcd-6834-4aed-913f-78d86318cd70' => 'Locks', + '4c94edcd-cde8-4d91-b5d5-78d86318cd70' => 'Management', + '4c94edcd-1014-4fd1-871c-78d86318cd70' => 'MeioUpload', + '4c94edcd-a7d4-40dd-ae3e-78d86318cd70' => 'Menus', + '4c94edcd-cd3c-4428-9327-78d86318cd70' => 'Migrations', + '4c94edcd-ed34-4a23-b4e2-78d86318cd70' => 'Modules', + '4c94edce-f07c-4564-bc30-78d86318cd70' => 'Newsletter', + '4c94edce-fa1c-4abb-9ca6-78d86318cd70' => 'Routes', + '4e287521-1b64-4feb-9e16-21136318cd70' => 'Security', + '4cfe4015-e438-488f-95bb-1bbd6318cd70' => 'ServerStatus', + '4cbd6788-2c28-4339-8917-47b96318cd70' => 'ShortUrls', + '4c94edce-a440-453b-bcda-78d86318cd70' => 'Tags', + '4c94edce-6ba4-4246-900f-78d86318cd70' => 'Themes', + '4cdc2282-927c-46c3-81ee-247a6318cd70' => 'Thickbox', + '4e28766e-9c54-40a6-818a-224c6318cd70' => 'Trash', + '4c94edce-fba0-4fee-bb03-78d86318cd70' => 'Users', + '4ce1695f-5488-4a9f-a5b8-1e806318cd70' => 'ViewCounter', + '4c94edce-f8dc-4dd3-907f-78d86318cd70' => 'Webmaster', + '4cdc22c5-c058-4049-9dc7-247a6318cd70' => 'WysiwygCkEditor', + '4cdc2320-49b4-417a-9dc5-247a6318cd70' => 'WysiwygTinyMce', + '4e28772d-3420-468b-8cf0-23506318cd70' => 'Xhprof', + ); + $this->assertEqual($expected, $this->Plugin->getInstalledPlugins()); + $this->assertEqual($expected, $this->Plugin->getInstalledPlugins('list')); + $this->assertEqual(46, $this->Plugin->getInstalledPlugins('count')); + + $this->assertTrue($this->Plugin->delete('4cdc2083-430c-42f1-be78-235e6318cd70')); + $this->assertTrue($this->Plugin->delete('4ce009fa-a76c-49f4-a488-120b6318cd70')); + $this->assertTrue($this->Plugin->delete('4c94edcb-4468-4d97-87ad-78d86318cd70')); + $this->assertTrue($this->Plugin->delete('4e286dc3-4454-4526-af0a-18876318cd70')); + $this->assertTrue($this->Plugin->delete('4e286eaa-0364-49b2-b6f2-18876318cd70')); + $this->assertTrue($this->Plugin->delete('4ce00a63-4e10-4cf2-b8d8-120b6318cd70')); + $this->assertTrue($this->Plugin->delete('4c94edcb-9624-4ce3-acfe-78d86318cd70')); + $this->assertTrue($this->Plugin->delete('4ce2a40a-5d8c-4157-b39e-133c6318cd70')); + $this->assertTrue($this->Plugin->delete('4c94edcc-4ec0-4c4e-97de-78d86318cd70')); + $this->assertTrue($this->Plugin->delete('4ce2a9b1-d348-4200-8828-15fb6318cd70')); + $this->assertTrue($this->Plugin->delete('4cfe3fcf-600c-4ae2-b655-1bbd6318cd70')); + $this->assertTrue($this->Plugin->delete('4c94edcc-ac70-474f-a4a3-78d86318cd70')); + $this->assertTrue($this->Plugin->delete('4cdc2397-f870-4615-ae65-247a6318cd70')); + $this->assertTrue($this->Plugin->delete('4e286f53-c380-4930-8c94-18876318cd70')); + $this->assertTrue($this->Plugin->delete('4cbc4e7e-b798-4aad-bc22-16836318cd70')); + $this->assertTrue($this->Plugin->delete('4c94edcc-9b50-49e6-9af3-78d86318cd70')); + $this->assertTrue($this->Plugin->delete('4e286fd1-2a3c-4775-9a87-18876318cd70')); + $this->assertTrue($this->Plugin->delete('4cbc74a9-8fe8-43da-aaa4-20786318cd70')); + $this->assertTrue($this->Plugin->delete('4c94edcc-aa7c-4509-9c18-78d86318cd70')); + + $expected = array( + '4c94edcc-84ec-47c9-963d-78d86318cd70' => 'Filter', + '4cdc264b-9d50-42b4-834b-2a206318cd70' => 'Gallery', + '4e2871cd-90c0-431c-9eee-18876318cd70' => 'Geshi', + '4c94edcb-3394-4e47-ad23-78d86318cd70' => 'Google', + '4c94edcc-e084-44d8-bce8-78d86318cd70' => 'Installer', + '4c94edcd-a188-49bb-8a08-78d86318cd70' => 'Libs', + '4c94edcd-6834-4aed-913f-78d86318cd70' => 'Locks', + '4c94edcd-cde8-4d91-b5d5-78d86318cd70' => 'Management', + '4c94edcd-1014-4fd1-871c-78d86318cd70' => 'MeioUpload', + '4c94edcd-a7d4-40dd-ae3e-78d86318cd70' => 'Menus', + '4c94edcd-cd3c-4428-9327-78d86318cd70' => 'Migrations', + '4c94edcd-ed34-4a23-b4e2-78d86318cd70' => 'Modules', + '4c94edce-f07c-4564-bc30-78d86318cd70' => 'Newsletter', + '4c94edce-fa1c-4abb-9ca6-78d86318cd70' => 'Routes', + '4e287521-1b64-4feb-9e16-21136318cd70' => 'Security', + '4cfe4015-e438-488f-95bb-1bbd6318cd70' => 'ServerStatus', + '4cbd6788-2c28-4339-8917-47b96318cd70' => 'ShortUrls', + '4c94edce-a440-453b-bcda-78d86318cd70' => 'Tags', + '4c94edce-6ba4-4246-900f-78d86318cd70' => 'Themes', + '4cdc2282-927c-46c3-81ee-247a6318cd70' => 'Thickbox', + '4e28766e-9c54-40a6-818a-224c6318cd70' => 'Trash', + '4c94edce-fba0-4fee-bb03-78d86318cd70' => 'Users', + '4ce1695f-5488-4a9f-a5b8-1e806318cd70' => 'ViewCounter', + '4c94edce-f8dc-4dd3-907f-78d86318cd70' => 'Webmaster', + '4cdc22c5-c058-4049-9dc7-247a6318cd70' => 'WysiwygCkEditor', + '4cdc2320-49b4-417a-9dc5-247a6318cd70' => 'WysiwygTinyMce', + '4e28772d-3420-468b-8cf0-23506318cd70' => 'Xhprof', + ); + $this->assertEqual($expected, $this->Plugin->getInstalledPlugins('list')); + $this->assertEqual($expected, $this->Plugin->getInstalledPlugins('whatever')); + $this->assertEqual(27, $this->Plugin->getInstalledPlugins('count')); + + $this->Plugin->deleteAll(array('Plugin.id' => array( + '4c94edcc-84ec-47c9-963d-78d86318cd70', '4cdc264b-9d50-42b4-834b-2a206318cd70', + '4e2871cd-90c0-431c-9eee-18876318cd70', '4c94edcb-3394-4e47-ad23-78d86318cd70', + '4c94edcc-e084-44d8-bce8-78d86318cd70', '4c94edcd-a188-49bb-8a08-78d86318cd70', + '4c94edcd-6834-4aed-913f-78d86318cd70', '4c94edcd-cde8-4d91-b5d5-78d86318cd70', + '4c94edcd-1014-4fd1-871c-78d86318cd70', '4c94edcd-a7d4-40dd-ae3e-78d86318cd70', + '4c94edcd-cd3c-4428-9327-78d86318cd70', '4c94edcd-ed34-4a23-b4e2-78d86318cd70', + '4c94edce-f07c-4564-bc30-78d86318cd70', '4c94edce-fa1c-4abb-9ca6-78d86318cd70', + '4e287521-1b64-4feb-9e16-21136318cd70', '4cfe4015-e438-488f-95bb-1bbd6318cd70', + '4cbd6788-2c28-4339-8917-47b96318cd70', '4c94edce-a440-453b-bcda-78d86318cd70', + '4c94edce-6ba4-4246-900f-78d86318cd70', '4cdc2282-927c-46c3-81ee-247a6318cd70', + '4e28766e-9c54-40a6-818a-224c6318cd70', '4c94edce-fba0-4fee-bb03-78d86318cd70' + ))); + } + +/** + * @test getting installed plugins + */ + public function testGetActiveInstalledPlugins() { + $this->disableBehavior('Trashable'); + + $expected = array( + '4c94edcb-3394-4e47-ad23-78d86318cd70' => 'Google', + '4c94edcb-4468-4d97-87ad-78d86318cd70' => 'Categories', + '4c94edcb-9624-4ce3-acfe-78d86318cd70' => 'Comments', + '4c94edcc-4ec0-4c4e-97de-78d86318cd70' => 'Contact', + '4c94edcc-84ec-47c9-963d-78d86318cd70' => 'Filter', + '4c94edcc-9b50-49e6-9af3-78d86318cd70' => 'Events', + '4c94edcc-aa7c-4509-9c18-78d86318cd70' => 'Filemanager', + '4c94edcc-ac70-474f-a4a3-78d86318cd70' => 'Data', + '4c94edcc-e084-44d8-bce8-78d86318cd70' => 'Installer', + '4c94edcd-1014-4fd1-871c-78d86318cd70' => 'MeioUpload', + '4c94edcd-6834-4aed-913f-78d86318cd70' => 'Locks', + '4c94edcd-a188-49bb-8a08-78d86318cd70' => 'Libs', + '4c94edcd-a7d4-40dd-ae3e-78d86318cd70' => 'Menus', + '4c94edcd-cd3c-4428-9327-78d86318cd70' => 'Migrations', + '4c94edcd-cde8-4d91-b5d5-78d86318cd70' => 'Management', + '4c94edcd-ed34-4a23-b4e2-78d86318cd70' => 'Modules', + '4c94edce-6ba4-4246-900f-78d86318cd70' => 'Themes', + '4c94edce-a440-453b-bcda-78d86318cd70' => 'Tags', + '4c94edce-f07c-4564-bc30-78d86318cd70' => 'Newsletter', + '4c94edce-f8dc-4dd3-907f-78d86318cd70' => 'Webmaster', + '4c94edce-fa1c-4abb-9ca6-78d86318cd70' => 'Routes', + '4c94edce-fba0-4fee-bb03-78d86318cd70' => 'Users', + '4cbc4e7e-b798-4aad-bc22-16836318cd70' => 'Emails', + '4cbc74a9-8fe8-43da-aaa4-20786318cd70' => 'Feed', + '4cbd6788-2c28-4339-8917-47b96318cd70' => 'ShortUrls', + '4cdc2083-430c-42f1-be78-235e6318cd70' => 'Backlinks', + '4cdc2282-927c-46c3-81ee-247a6318cd70' => 'Thickbox', + '4cdc22c5-c058-4049-9dc7-247a6318cd70' => 'WysiwygCkEditor', + '4cdc2320-49b4-417a-9dc5-247a6318cd70' => 'WysiwygTinyMce', + '4cdc2397-f870-4615-ae65-247a6318cd70' => 'DebugKit', + '4cdc264b-9d50-42b4-834b-2a206318cd70' => 'Gallery', + '4ce009fa-a76c-49f4-a488-120b6318cd70' => 'Blog', + '4ce00a63-4e10-4cf2-b8d8-120b6318cd70' => 'Cms', + '4ce1695f-5488-4a9f-a5b8-1e806318cd70' => 'ViewCounter', + '4ce2a40a-5d8c-4157-b39e-133c6318cd70' => 'Configs', + '4ce2a9b1-d348-4200-8828-15fb6318cd70' => 'Contents', + '4cfe3fcf-600c-4ae2-b655-1bbd6318cd70' => 'Crons', + '4cfe4015-e438-488f-95bb-1bbd6318cd70' => 'ServerStatus', + '4e286dc3-4454-4526-af0a-18876318cd70' => 'Charts', + '4e286eaa-0364-49b2-b6f2-18876318cd70' => 'ClearCache', + '4e286f53-c380-4930-8c94-18876318cd70' => 'Dev', + '4e286fd1-2a3c-4775-9a87-18876318cd70' => 'Facebook', + '4e2871cd-90c0-431c-9eee-18876318cd70' => 'Geshi', + '4e287521-1b64-4feb-9e16-21136318cd70' => 'Security', + ); + $this->assertEqual($expected, $this->Plugin->getActiveInstalledPlugins()); + $this->assertEqual($expected, $this->Plugin->getActiveInstalledPlugins('list')); + $this->assertEqual($expected, $this->Plugin->getActiveInstalledPlugins('whatever')); + $this->assertEqual(44, $this->Plugin->getActiveInstalledPlugins('count')); + + $this->assertTrue( + $this->Plugin->updateAll( + array('active' => 0), + array('Plugin.id' => array('4c94edcc-9b50-49e6-9af3-78d86318cd70', '4e286fd1-2a3c-4775-9a87-18876318cd70', '4cbc74a9-8fe8-43da-aaa4-20786318cd70', '4c94edcc-aa7c-4509-9c18-78d86318cd70')) + ) + ); + $this->assertEqual(43, $this->Plugin->getActiveInstalledPlugins('count')); + } + +/** + * @test get plugins that are not installed + */ + public function testGetNonInstalledPlugins() { + $this->disableBehavior('Trashable'); + + $notInstalled = array_values($this->Plugin->getNonInstalledPlugins()); + $this->Plugin->delete('4cdc2282-927c-46c3-81ee-247a6318cd70'); + + $notInstalled2 = array_values($this->Plugin->getNonInstalledPlugins()); + $this->assertIdentical(count($notInstalled) + 1, count($notInstalled2)); + $this->assertIdentical(count($notInstalled2), $this->Plugin->getNonInstalledPlugins('count')); + + $this->assertEqual('Thickbox', current(array_diff($notInstalled2, $notInstalled))); + } + +/** + * @test checking if a plugin is installed + */ + public function testIsInstalled() { + $this->disableBehavior('Trashable'); + + $this->assertFalse($this->Plugin->isInstalled()); + $this->assertFalse($this->Plugin->isInstalled(false)); + $this->assertFalse($this->Plugin->isInstalled('fake-plugin')); + + $this->assertTrue($this->Plugin->isInstalled('Trash')); + $this->assertTrue($this->Plugin->isInstalled('trash')); + + $this->assertTrue($this->Plugin->isInstalled('ClearCache')); + $this->assertTrue($this->Plugin->isInstalled('clear_cache')); + + $this->Plugin->delete('4e286eaa-0364-49b2-b6f2-18876318cd70'); + + $this->assertFalse($this->Plugin->isInstalled('ClearCache')); + $this->assertFalse($this->Plugin->isInstalled('clear_cache')); + } + +/** + * @brief you should have all the supported plugins available for testing plugins + * @test installing a plugin + */ + public function testInstallPlugin() { + $SchemaMigration = ClassRegistry::init('SchemaMigration'); + + $this->assertTrue($this->Plugin->installPlugin('Twitter')); + $this->assertEqual('Twitter', $this->Plugin->field('name')); + + $this->assertTrue($this->Plugin->installPlugin('Blog')); + $this->assertEqual('Blog', $this->Plugin->field('name')); + + $count = $SchemaMigration->find('count'); + $this->assertTrue($this->Plugin->installPlugin('Blog')); + $this->assertEqual('Blog', $this->Plugin->field('name')); + $this->assertIdentical($count, $SchemaMigration->find('count')); + + $this->assertTrue($this->Plugin->installPlugin('Locks')); + } +} \ No newline at end of file diff --git a/Core/Installer/Test/Case/Models/PluginTest.php b/Core/Installer/Test/Case/Models/PluginTest.php deleted file mode 100755 index 90a628e49..000000000 --- a/Core/Installer/Test/Case/Models/PluginTest.php +++ /dev/null @@ -1,316 +0,0 @@ - array( - * 'do' => array( - * 'SomePlugin.SomeModel - * ), - * 'replace' => array( - * 'Core.User' => 'SomePlugin.User - * ) - * ) - * @var array - */ - public $setup = array( - 'model' => 'Installer.Plugin', - 'fixtures' => array( - 'do' => array( - 'Migrations.SchemaMigration', - ) - ) - ); - - /** - * @brief Contains a list of test methods to run - * - * If it is set to false all the methods will run. Otherwise pass in an array - * with a list of tests to run. - * - * @var mixed - */ - public $tests = false; - - /** - * @brief Tests Validation - * - * @test Enter description here - */ - public function testValidation() { - - } - - /** - * @test getting all plugins within the system - */ - public function testGetAllPlugins() { - $plugins = App::objects('plugin'); - natsort($plugins); - - $this->assertEqual($plugins, $this->Plugin->getAllPlugins()); - $this->assertEqual($plugins, $this->Plugin->getAllPlugins('list')); - $this->assertEqual($plugins, $this->Plugin->getAllPlugins('whatever')); - - $this->assertEqual(count(App::objects('plugin')), $this->Plugin->getAllPlugins('count')); - } - - /** - * @test getting installed plugins - */ - public function testGetInstalledPlugins() { - $this->disableBehavior('Trashable'); - - $expected = array( - '4cdc2083-430c-42f1-be78-235e6318cd70' => 'Backlinks', - '4ce009fa-a76c-49f4-a488-120b6318cd70' => 'Blog', - '4c94edcb-4468-4d97-87ad-78d86318cd70' => 'Categories', - '4e286dc3-4454-4526-af0a-18876318cd70' => 'Charts', - '4e286eaa-0364-49b2-b6f2-18876318cd70' => 'ClearCache', - '4ce00a63-4e10-4cf2-b8d8-120b6318cd70' => 'Cms', - '4c94edcb-9624-4ce3-acfe-78d86318cd70' => 'Comments', - '4ce2a40a-5d8c-4157-b39e-133c6318cd70' => 'Configs', - '4c94edcc-4ec0-4c4e-97de-78d86318cd70' => 'Contact', - '4ce2a9b1-d348-4200-8828-15fb6318cd70' => 'Contents', - '4cfe3fcf-600c-4ae2-b655-1bbd6318cd70' => 'Crons', - '4c94edcc-ac70-474f-a4a3-78d86318cd70' => 'Data', - '4cdc2397-f870-4615-ae65-247a6318cd70' => 'DebugKit', - '4e286f53-c380-4930-8c94-18876318cd70' => 'Dev', - '4cbc4e7e-b798-4aad-bc22-16836318cd70' => 'Emails', - '4c94edcc-9b50-49e6-9af3-78d86318cd70' => 'Events', - '4e286fd1-2a3c-4775-9a87-18876318cd70' => 'Facebook', - '4cbc74a9-8fe8-43da-aaa4-20786318cd70' => 'Feed', - '4c94edcc-aa7c-4509-9c18-78d86318cd70' => 'Filemanager', - '4c94edcc-84ec-47c9-963d-78d86318cd70' => 'Filter', - '4cdc264b-9d50-42b4-834b-2a206318cd70' => 'Gallery', - '4e2871cd-90c0-431c-9eee-18876318cd70' => 'Geshi', - '4c94edcb-3394-4e47-ad23-78d86318cd70' => 'Google', - '4c94edcc-e084-44d8-bce8-78d86318cd70' => 'Installer', - '4c94edcd-a188-49bb-8a08-78d86318cd70' => 'Libs', - '4c94edcd-6834-4aed-913f-78d86318cd70' => 'Locks', - '4c94edcd-cde8-4d91-b5d5-78d86318cd70' => 'Management', - '4c94edcd-1014-4fd1-871c-78d86318cd70' => 'MeioUpload', - '4c94edcd-a7d4-40dd-ae3e-78d86318cd70' => 'Menus', - '4c94edcd-cd3c-4428-9327-78d86318cd70' => 'Migrations', - '4c94edcd-ed34-4a23-b4e2-78d86318cd70' => 'Modules', - '4c94edce-f07c-4564-bc30-78d86318cd70' => 'Newsletter', - '4c94edce-fa1c-4abb-9ca6-78d86318cd70' => 'Routes', - '4e287521-1b64-4feb-9e16-21136318cd70' => 'Security', - '4cfe4015-e438-488f-95bb-1bbd6318cd70' => 'ServerStatus', - '4cbd6788-2c28-4339-8917-47b96318cd70' => 'ShortUrls', - '4c94edce-a440-453b-bcda-78d86318cd70' => 'Tags', - '4c94edce-6ba4-4246-900f-78d86318cd70' => 'Themes', - '4cdc2282-927c-46c3-81ee-247a6318cd70' => 'Thickbox', - '4e28766e-9c54-40a6-818a-224c6318cd70' => 'Trash', - '4c94edce-fba0-4fee-bb03-78d86318cd70' => 'Users', - '4ce1695f-5488-4a9f-a5b8-1e806318cd70' => 'ViewCounter', - '4c94edce-f8dc-4dd3-907f-78d86318cd70' => 'Webmaster', - '4cdc22c5-c058-4049-9dc7-247a6318cd70' => 'WysiwygCkEditor', - '4cdc2320-49b4-417a-9dc5-247a6318cd70' => 'WysiwygTinyMce', - '4e28772d-3420-468b-8cf0-23506318cd70' => 'Xhprof', - ); - $this->assertEqual($expected, $this->Plugin->getInstalledPlugins()); - $this->assertEqual($expected, $this->Plugin->getInstalledPlugins('list')); - $this->assertEqual(46, $this->Plugin->getInstalledPlugins('count')); - - $this->assertTrue($this->Plugin->delete('4cdc2083-430c-42f1-be78-235e6318cd70')); - $this->assertTrue($this->Plugin->delete('4ce009fa-a76c-49f4-a488-120b6318cd70')); - $this->assertTrue($this->Plugin->delete('4c94edcb-4468-4d97-87ad-78d86318cd70')); - $this->assertTrue($this->Plugin->delete('4e286dc3-4454-4526-af0a-18876318cd70')); - $this->assertTrue($this->Plugin->delete('4e286eaa-0364-49b2-b6f2-18876318cd70')); - $this->assertTrue($this->Plugin->delete('4ce00a63-4e10-4cf2-b8d8-120b6318cd70')); - $this->assertTrue($this->Plugin->delete('4c94edcb-9624-4ce3-acfe-78d86318cd70')); - $this->assertTrue($this->Plugin->delete('4ce2a40a-5d8c-4157-b39e-133c6318cd70')); - $this->assertTrue($this->Plugin->delete('4c94edcc-4ec0-4c4e-97de-78d86318cd70')); - $this->assertTrue($this->Plugin->delete('4ce2a9b1-d348-4200-8828-15fb6318cd70')); - $this->assertTrue($this->Plugin->delete('4cfe3fcf-600c-4ae2-b655-1bbd6318cd70')); - $this->assertTrue($this->Plugin->delete('4c94edcc-ac70-474f-a4a3-78d86318cd70')); - $this->assertTrue($this->Plugin->delete('4cdc2397-f870-4615-ae65-247a6318cd70')); - $this->assertTrue($this->Plugin->delete('4e286f53-c380-4930-8c94-18876318cd70')); - $this->assertTrue($this->Plugin->delete('4cbc4e7e-b798-4aad-bc22-16836318cd70')); - $this->assertTrue($this->Plugin->delete('4c94edcc-9b50-49e6-9af3-78d86318cd70')); - $this->assertTrue($this->Plugin->delete('4e286fd1-2a3c-4775-9a87-18876318cd70')); - $this->assertTrue($this->Plugin->delete('4cbc74a9-8fe8-43da-aaa4-20786318cd70')); - $this->assertTrue($this->Plugin->delete('4c94edcc-aa7c-4509-9c18-78d86318cd70')); - - $expected = array( - '4c94edcc-84ec-47c9-963d-78d86318cd70' => 'Filter', - '4cdc264b-9d50-42b4-834b-2a206318cd70' => 'Gallery', - '4e2871cd-90c0-431c-9eee-18876318cd70' => 'Geshi', - '4c94edcb-3394-4e47-ad23-78d86318cd70' => 'Google', - '4c94edcc-e084-44d8-bce8-78d86318cd70' => 'Installer', - '4c94edcd-a188-49bb-8a08-78d86318cd70' => 'Libs', - '4c94edcd-6834-4aed-913f-78d86318cd70' => 'Locks', - '4c94edcd-cde8-4d91-b5d5-78d86318cd70' => 'Management', - '4c94edcd-1014-4fd1-871c-78d86318cd70' => 'MeioUpload', - '4c94edcd-a7d4-40dd-ae3e-78d86318cd70' => 'Menus', - '4c94edcd-cd3c-4428-9327-78d86318cd70' => 'Migrations', - '4c94edcd-ed34-4a23-b4e2-78d86318cd70' => 'Modules', - '4c94edce-f07c-4564-bc30-78d86318cd70' => 'Newsletter', - '4c94edce-fa1c-4abb-9ca6-78d86318cd70' => 'Routes', - '4e287521-1b64-4feb-9e16-21136318cd70' => 'Security', - '4cfe4015-e438-488f-95bb-1bbd6318cd70' => 'ServerStatus', - '4cbd6788-2c28-4339-8917-47b96318cd70' => 'ShortUrls', - '4c94edce-a440-453b-bcda-78d86318cd70' => 'Tags', - '4c94edce-6ba4-4246-900f-78d86318cd70' => 'Themes', - '4cdc2282-927c-46c3-81ee-247a6318cd70' => 'Thickbox', - '4e28766e-9c54-40a6-818a-224c6318cd70' => 'Trash', - '4c94edce-fba0-4fee-bb03-78d86318cd70' => 'Users', - '4ce1695f-5488-4a9f-a5b8-1e806318cd70' => 'ViewCounter', - '4c94edce-f8dc-4dd3-907f-78d86318cd70' => 'Webmaster', - '4cdc22c5-c058-4049-9dc7-247a6318cd70' => 'WysiwygCkEditor', - '4cdc2320-49b4-417a-9dc5-247a6318cd70' => 'WysiwygTinyMce', - '4e28772d-3420-468b-8cf0-23506318cd70' => 'Xhprof', - ); - $this->assertEqual($expected, $this->Plugin->getInstalledPlugins('list')); - $this->assertEqual($expected, $this->Plugin->getInstalledPlugins('whatever')); - $this->assertEqual(27, $this->Plugin->getInstalledPlugins('count')); - - $this->Plugin->deleteAll(array('Plugin.id' => array( - '4c94edcc-84ec-47c9-963d-78d86318cd70', '4cdc264b-9d50-42b4-834b-2a206318cd70', - '4e2871cd-90c0-431c-9eee-18876318cd70', '4c94edcb-3394-4e47-ad23-78d86318cd70', - '4c94edcc-e084-44d8-bce8-78d86318cd70', '4c94edcd-a188-49bb-8a08-78d86318cd70', - '4c94edcd-6834-4aed-913f-78d86318cd70', '4c94edcd-cde8-4d91-b5d5-78d86318cd70', - '4c94edcd-1014-4fd1-871c-78d86318cd70', '4c94edcd-a7d4-40dd-ae3e-78d86318cd70', - '4c94edcd-cd3c-4428-9327-78d86318cd70', '4c94edcd-ed34-4a23-b4e2-78d86318cd70', - '4c94edce-f07c-4564-bc30-78d86318cd70', '4c94edce-fa1c-4abb-9ca6-78d86318cd70', - '4e287521-1b64-4feb-9e16-21136318cd70', '4cfe4015-e438-488f-95bb-1bbd6318cd70', - '4cbd6788-2c28-4339-8917-47b96318cd70', '4c94edce-a440-453b-bcda-78d86318cd70', - '4c94edce-6ba4-4246-900f-78d86318cd70', '4cdc2282-927c-46c3-81ee-247a6318cd70', - '4e28766e-9c54-40a6-818a-224c6318cd70', '4c94edce-fba0-4fee-bb03-78d86318cd70' - ))); - } - - /** - * @test getting installed plugins - */ - public function testGetActiveInstalledPlugins() { - $this->disableBehavior('Trashable'); - - $expected = array( - '4c94edcb-3394-4e47-ad23-78d86318cd70' => 'Google', - '4c94edcb-4468-4d97-87ad-78d86318cd70' => 'Categories', - '4c94edcb-9624-4ce3-acfe-78d86318cd70' => 'Comments', - '4c94edcc-4ec0-4c4e-97de-78d86318cd70' => 'Contact', - '4c94edcc-84ec-47c9-963d-78d86318cd70' => 'Filter', - '4c94edcc-9b50-49e6-9af3-78d86318cd70' => 'Events', - '4c94edcc-aa7c-4509-9c18-78d86318cd70' => 'Filemanager', - '4c94edcc-ac70-474f-a4a3-78d86318cd70' => 'Data', - '4c94edcc-e084-44d8-bce8-78d86318cd70' => 'Installer', - '4c94edcd-1014-4fd1-871c-78d86318cd70' => 'MeioUpload', - '4c94edcd-6834-4aed-913f-78d86318cd70' => 'Locks', - '4c94edcd-a188-49bb-8a08-78d86318cd70' => 'Libs', - '4c94edcd-a7d4-40dd-ae3e-78d86318cd70' => 'Menus', - '4c94edcd-cd3c-4428-9327-78d86318cd70' => 'Migrations', - '4c94edcd-cde8-4d91-b5d5-78d86318cd70' => 'Management', - '4c94edcd-ed34-4a23-b4e2-78d86318cd70' => 'Modules', - '4c94edce-6ba4-4246-900f-78d86318cd70' => 'Themes', - '4c94edce-a440-453b-bcda-78d86318cd70' => 'Tags', - '4c94edce-f07c-4564-bc30-78d86318cd70' => 'Newsletter', - '4c94edce-f8dc-4dd3-907f-78d86318cd70' => 'Webmaster', - '4c94edce-fa1c-4abb-9ca6-78d86318cd70' => 'Routes', - '4c94edce-fba0-4fee-bb03-78d86318cd70' => 'Users', - '4cbc4e7e-b798-4aad-bc22-16836318cd70' => 'Emails', - '4cbc74a9-8fe8-43da-aaa4-20786318cd70' => 'Feed', - '4cbd6788-2c28-4339-8917-47b96318cd70' => 'ShortUrls', - '4cdc2083-430c-42f1-be78-235e6318cd70' => 'Backlinks', - '4cdc2282-927c-46c3-81ee-247a6318cd70' => 'Thickbox', - '4cdc22c5-c058-4049-9dc7-247a6318cd70' => 'WysiwygCkEditor', - '4cdc2320-49b4-417a-9dc5-247a6318cd70' => 'WysiwygTinyMce', - '4cdc2397-f870-4615-ae65-247a6318cd70' => 'DebugKit', - '4cdc264b-9d50-42b4-834b-2a206318cd70' => 'Gallery', - '4ce009fa-a76c-49f4-a488-120b6318cd70' => 'Blog', - '4ce00a63-4e10-4cf2-b8d8-120b6318cd70' => 'Cms', - '4ce1695f-5488-4a9f-a5b8-1e806318cd70' => 'ViewCounter', - '4ce2a40a-5d8c-4157-b39e-133c6318cd70' => 'Configs', - '4ce2a9b1-d348-4200-8828-15fb6318cd70' => 'Contents', - '4cfe3fcf-600c-4ae2-b655-1bbd6318cd70' => 'Crons', - '4cfe4015-e438-488f-95bb-1bbd6318cd70' => 'ServerStatus', - '4e286dc3-4454-4526-af0a-18876318cd70' => 'Charts', - '4e286eaa-0364-49b2-b6f2-18876318cd70' => 'ClearCache', - '4e286f53-c380-4930-8c94-18876318cd70' => 'Dev', - '4e286fd1-2a3c-4775-9a87-18876318cd70' => 'Facebook', - '4e2871cd-90c0-431c-9eee-18876318cd70' => 'Geshi', - '4e287521-1b64-4feb-9e16-21136318cd70' => 'Security', - ); - $this->assertEqual($expected, $this->Plugin->getActiveInstalledPlugins()); - $this->assertEqual($expected, $this->Plugin->getActiveInstalledPlugins('list')); - $this->assertEqual($expected, $this->Plugin->getActiveInstalledPlugins('whatever')); - $this->assertEqual(44, $this->Plugin->getActiveInstalledPlugins('count')); - - $this->assertTrue( - $this->Plugin->updateAll( - array('active' => 0), - array('Plugin.id' => array('4c94edcc-9b50-49e6-9af3-78d86318cd70', '4e286fd1-2a3c-4775-9a87-18876318cd70', '4cbc74a9-8fe8-43da-aaa4-20786318cd70', '4c94edcc-aa7c-4509-9c18-78d86318cd70')) - ) - ); - $this->assertEqual(43, $this->Plugin->getActiveInstalledPlugins('count')); - } - - /** - * @test get plugins that are not installed - */ - public function testGetNonInstalledPlugins() { - $this->disableBehavior('Trashable'); - - $notInstalled = array_values($this->Plugin->getNonInstalledPlugins()); - $this->Plugin->delete('4cdc2282-927c-46c3-81ee-247a6318cd70'); - - $notInstalled2 = array_values($this->Plugin->getNonInstalledPlugins()); - $this->assertIdentical(count($notInstalled) + 1, count($notInstalled2)); - $this->assertIdentical(count($notInstalled2), $this->Plugin->getNonInstalledPlugins('count')); - - $this->assertEqual('Thickbox', current(array_diff($notInstalled2, $notInstalled))); - } - - /** - * @test checking if a plugin is installed - */ - public function testIsInstalled() { - $this->disableBehavior('Trashable'); - - $this->assertFalse($this->Plugin->isInstalled()); - $this->assertFalse($this->Plugin->isInstalled(false)); - $this->assertFalse($this->Plugin->isInstalled('fake-plugin')); - - $this->assertTrue($this->Plugin->isInstalled('Trash')); - $this->assertTrue($this->Plugin->isInstalled('trash')); - - $this->assertTrue($this->Plugin->isInstalled('ClearCache')); - $this->assertTrue($this->Plugin->isInstalled('clear_cache')); - - $this->Plugin->delete('4e286eaa-0364-49b2-b6f2-18876318cd70'); - - $this->assertFalse($this->Plugin->isInstalled('ClearCache')); - $this->assertFalse($this->Plugin->isInstalled('clear_cache')); - } - - /** - * @brief you should have all the supported plugins available for testing plugins - * @test installing a plugin - */ - public function testInstallPlugin() { - $SchemaMigration = ClassRegistry::init('SchemaMigration'); - - $this->assertTrue($this->Plugin->installPlugin('Twitter')); - $this->assertEqual('Twitter', $this->Plugin->field('name')); - - $this->assertTrue($this->Plugin->installPlugin('Blog')); - $this->assertEqual('Blog', $this->Plugin->field('name')); - - $count = $SchemaMigration->find('count'); - $this->assertTrue($this->Plugin->installPlugin('Blog')); - $this->assertEqual('Blog', $this->Plugin->field('name')); - $this->assertIdentical($count, $SchemaMigration->find('count')); - - $this->assertTrue($this->Plugin->installPlugin('Locks')); - } - } \ No newline at end of file diff --git a/Core/Locks/Test/Case/Model/LockTest.php b/Core/Locks/Test/Case/Model/LockTest.php index f07b2ab52..fbe8f4406 100644 --- a/Core/Locks/Test/Case/Model/LockTest.php +++ b/Core/Locks/Test/Case/Model/LockTest.php @@ -6,7 +6,6 @@ * */ class LockTest extends CakeTestCase { - /** * Fixtures * @@ -14,8 +13,8 @@ class LockTest extends CakeTestCase { */ public $fixtures = array( 'plugin.locks.lock', - 'plugin.locks.user', - 'plugin.locks.group' + 'plugin.users.user', + 'plugin.users.group' ); /** diff --git a/Core/Migrations/Test/Case/Model/SchemaMigrationTest.php b/Core/Migrations/Test/Case/Model/SchemaMigrationTest.php new file mode 100755 index 000000000..bb4c7e928 --- /dev/null +++ b/Core/Migrations/Test/Case/Model/SchemaMigrationTest.php @@ -0,0 +1,11 @@ + array( - * 'do' => array( - * 'SomePlugin.SomeModel - * ), - * 'replace' => array( - * 'Core.User' => 'SomePlugin.User - * ) - * ) - * @var array - */ - public $setup = array( - 'model' => 'migrations.SchemaMigration' - ); - - /** - * @brief Contains a list of test methods to run - * - * If it is set to false all the methods will run. Otherwise pass in an array - * with a list of tests to run. - * - * @var mixed - */ - public $tests = false; - - /** - * @brief Tests Validation - * - * @test Enter description here - */ - public function testValidation() { - - } - } \ No newline at end of file diff --git a/Core/Newsletter/Test/Case/Model/CampaignTest.php b/Core/Newsletter/Test/Case/Model/CampaignTest.php index 38339ee25..ea53d7b82 100644 --- a/Core/Newsletter/Test/Case/Model/CampaignTest.php +++ b/Core/Newsletter/Test/Case/Model/CampaignTest.php @@ -13,13 +13,13 @@ class CampaignTest extends CakeTestCase { * @var array */ public $fixtures = array( + 'plugin.newsletter.newsletter', 'plugin.newsletter.campaign', 'plugin.newsletter.template', - 'plugin.newsletter.newsletter', - 'plugin.newsletter.view_counter_view', - 'plugin.newsletter.user', - 'plugin.newsletter.group', - 'plugin.newsletter.newsletters_user' + 'plugin.newsletter.newsletters_user', + 'plugin.view_counter.view_counter_view', + 'plugin.users.user', + 'plugin.users.group', ); /** diff --git a/Core/Newsletter/Test/Case/Model/NewsletterTest.php b/Core/Newsletter/Test/Case/Model/NewsletterTest.php index 2d72f8cd0..418274bf3 100644 --- a/Core/Newsletter/Test/Case/Model/NewsletterTest.php +++ b/Core/Newsletter/Test/Case/Model/NewsletterTest.php @@ -16,10 +16,10 @@ class NewsletterTest extends CakeTestCase { 'plugin.newsletter.newsletter', 'plugin.newsletter.campaign', 'plugin.newsletter.template', - 'plugin.newsletter.view_counter_view', - 'plugin.newsletter.user', - 'plugin.newsletter.group', - 'plugin.newsletter.newsletters_user' + 'plugin.newsletter.newsletters_user', + 'plugin.view_counter.view_counter_view', + 'plugin.users.user', + 'plugin.users.group', ); /** diff --git a/Core/Newsletter/Test/Case/Model/TemplateTest.php b/Core/Newsletter/Test/Case/Model/TemplateTest.php index 82d1e2e60..114641e00 100644 --- a/Core/Newsletter/Test/Case/Model/TemplateTest.php +++ b/Core/Newsletter/Test/Case/Model/TemplateTest.php @@ -13,13 +13,13 @@ class TemplateTest extends CakeTestCase { * @var array */ public $fixtures = array( - 'plugin.newsletter.template', 'plugin.newsletter.newsletter', 'plugin.newsletter.campaign', - 'plugin.newsletter.view_counter_view', - 'plugin.newsletter.user', - 'plugin.newsletter.group', - 'plugin.newsletter.newsletters_user' + 'plugin.newsletter.template', + 'plugin.newsletter.newsletters_user', + 'plugin.view_counter.view_counter_view', + 'plugin.users.user', + 'plugin.users.group', ); /** diff --git a/Core/ServerStatus/Test/Case/Model/ServerStatusTest.php b/Core/ServerStatus/Test/Case/Model/ServerStatusTest.php index 80a51f485..99ed491d8 100644 --- a/Core/ServerStatus/Test/Case/Model/ServerStatusTest.php +++ b/Core/ServerStatus/Test/Case/Model/ServerStatusTest.php @@ -13,7 +13,7 @@ class ServerStatusTest extends CakeTestCase { * @var array */ public $fixtures = array( - 'plugin.server_status.server_status' + 'plugin.crons.cron' ); /** diff --git a/Core/ShortUrls/Test/Case/Model/ShortUrlTest.php b/Core/ShortUrls/Test/Case/Model/ShortUrlTest.php index 283af90a6..7613f476a 100644 --- a/Core/ShortUrls/Test/Case/Model/ShortUrlTest.php +++ b/Core/ShortUrls/Test/Case/Model/ShortUrlTest.php @@ -14,7 +14,7 @@ class ShortUrlTest extends CakeTestCase { */ public $fixtures = array( 'plugin.short_urls.short_url', - 'plugin.short_urls.view_counter_view' + 'plugin.view_counter.view_counter_view' ); /** diff --git a/Core/Trash/Test/Case/Model/TrashTest.php b/Core/Trash/Test/Case/Model/TrashTest.php index b0adaacff..9c4c424e1 100644 --- a/Core/Trash/Test/Case/Model/TrashTest.php +++ b/Core/Trash/Test/Case/Model/TrashTest.php @@ -14,8 +14,8 @@ class TrashTest extends CakeTestCase { */ public $fixtures = array( 'plugin.trash.trash', - 'plugin.trash.user', - 'plugin.trash.group' + 'plugin.users.user', + 'plugin.users.group' ); /** diff --git a/Plugin/InfinitasJobs b/Plugin/InfinitasJobs index 99deb0b61..c1f6e6455 160000 --- a/Plugin/InfinitasJobs +++ b/Plugin/InfinitasJobs @@ -1 +1 @@ -Subproject commit 99deb0b61bdc7147d4c5760587e888474796a20a +Subproject commit c1f6e64555e402c47d38f829b3cd991376340a18 diff --git a/Plugin/Twitter b/Plugin/Twitter index 75a79ce8c..8e3aee3e7 160000 --- a/Plugin/Twitter +++ b/Plugin/Twitter @@ -1 +1 @@ -Subproject commit 75a79ce8c8c054756ec9add5b9c3af70a9ee2a05 +Subproject commit 8e3aee3e751744324e89d8186c8607c5c422ddb6