diff --git a/flag.info.yml b/flag.info.yml index 94c948a..f5c97e0 100644 --- a/flag.info.yml +++ b/flag.info.yml @@ -6,4 +6,3 @@ package: Flags configure: flag.list dependencies: - views_ui - - rules diff --git a/src/Tests/Integration/Action/ActionFlagTest.php b/src/Tests/Integration/Action/ActionFlagTest.php deleted file mode 100644 index 2cf427e..0000000 --- a/src/Tests/Integration/Action/ActionFlagTest.php +++ /dev/null @@ -1,67 +0,0 @@ -getFlagServiceMock(); - $this->container->set('flag', $flag_service_mock); - - $action = $this->getFlagAction(); - - $this->assertEquals('flag entity', $action->summary()); - } - - /** - * Tests the execution of the flag action. - * - * @covers ::execute - */ - public function testActionFlag() { - $flag_service_mock = $this->getFlagServiceMock(); - $flag_service_mock - ->expects($this->once()) - ->method('flag') - ->will($this->returnValue([])); - $this->container->set('flag', $flag_service_mock); - - $entity = $this->getNodeMock(); - - $flag = $this->getFlagMock(); - - $action = $this->getFlagAction(); - $action->setContextValue('entity', $entity); - $action->setContextValue('flag', $flag); - $action->execute(); - } - - /** - * Helper function to create a 'flag_action_flag' action. - * - * @return \Drupal\flag\Plugin\RulesAction\Flag - * The Flag action object - */ - protected function getFlagAction() { - return $this->actionManager->createInstance('flag_action_flag'); - } - -} diff --git a/src/Tests/Integration/Action/ActionUnFlagTest.php b/src/Tests/Integration/Action/ActionUnFlagTest.php deleted file mode 100644 index 3666448..0000000 --- a/src/Tests/Integration/Action/ActionUnFlagTest.php +++ /dev/null @@ -1,67 +0,0 @@ -getFlagServiceMock(); - $this->container->set('flag', $flag_service_mock); - - $action = $this->getUnFlagAction(); - - $this->assertEquals('unflag entity', $action->summary()); - } - - /** - * Tests the execution of the unflag action. - * - * @covers ::execute - */ - public function testActionFlag() { - $flag_service_mock = $this->getFlagServiceMock(); - $flag_service_mock - ->expects($this->once()) - ->method('unflag') - ->will($this->returnValue([])); - $this->container->set('flag', $flag_service_mock); - - $entity = $this->getNodeMock(); - - $flag = $this->getFlagMock(); - - $action = $this->getUnFlagAction(); - $action->setContextValue('entity', $entity); - $action->setContextValue('flag', $flag); - $action->execute(); - } - - /** - * Helper function to create a 'flag_action_flag' action. - * - * @return \Drupal\flag\Plugin\RulesAction\UnFlag - * The UnFlag action object. - */ - protected function getUnFlagAction() { - return $this->actionManager->createInstance('flag_action_unflag'); - } - -} diff --git a/src/Tests/Integration/FlagIntegrationTestBase.php b/src/Tests/Integration/FlagIntegrationTestBase.php deleted file mode 100644 index 783e4a0..0000000 --- a/src/Tests/Integration/FlagIntegrationTestBase.php +++ /dev/null @@ -1,71 +0,0 @@ -enableModule('flag', ['Drupal\\flag' => $this->root . '/modules/flag/src']); - $this->namespaces['Drupal\\flag'] = __DIR__ . '/../..'; - - $flagtype_mock = $this->getMockBuilder('Drupal\flag\FlagTypePluginManager') - ->disableOriginalConstructor() - ->getMock(); - $this->container->set('plugin.manager.flag.flagtype', $flagtype_mock); - - $linktype_mock = $this->getMockBuilder('Drupal\flag\ActionLinkPluginManager') - ->disableOriginalConstructor() - ->getMock(); - $this->container->set('plugin.manager.flag.linktype', $linktype_mock); - } - - /** - * Helper function to create a mock of 'Drupal\flag\FlagService'. - * - * @return \PHPUnit_Framework_MockObject_MockObject - * A mock FlagService object. - */ - protected function getFlagServiceMock() { - return $this->getMockBuilder('Drupal\flag\FlagService') - ->disableOriginalConstructor() - ->getMock(); - } - - /** - * Helper function to create a mock of 'Drupal\flag\Entity\Flag'. - * - * @return \PHPUnit_Framework_MockObject_MockObject - * A mock Flag object. - */ - protected function getFlagMock() { - return $this->getMockBuilder('Drupal\flag\Entity\Flag') - ->disableOriginalConstructor() - ->getMock(); - } - - /** - * Helper function to create a mock of 'Drupal\Core\Entity\Entity'. - * - * @return \PHPUnit_Framework_MockObject_MockObject - * A mock Entity object. - */ - protected function getNodeMock() { - return $this->getMockBuilder('Drupal\Core\Entity\Entity') - ->disableOriginalConstructor() - ->getMock(); - } - -}