12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace Tests\Contacts\ContactsMenu;
- use OC\Contacts\ContactsMenu\ActionFactory;
- use OCP\Contacts\ContactsMenu\IAction;
- use Test\TestCase;
- class ActionFactoryTest extends TestCase {
- private ActionFactory $actionFactory;
- protected function setUp(): void {
- parent::setUp();
- $this->actionFactory = new ActionFactory();
- }
- public function testNewLinkAction() {
- $icon = 'icon-test';
- $name = 'Test';
- $href = 'some/url';
- $action = $this->actionFactory->newLinkAction($icon, $name, $href);
- $this->assertInstanceOf(IAction::class, $action);
- $this->assertEquals($name, $action->getName());
- $this->assertEquals(10, $action->getPriority());
- }
- public function testNewEMailAction() {
- $icon = 'icon-test';
- $name = 'Test';
- $href = 'user@example.com';
- $action = $this->actionFactory->newEMailAction($icon, $name, $href);
- $this->assertInstanceOf(IAction::class, $action);
- $this->assertEquals($name, $action->getName());
- $this->assertEquals(10, $action->getPriority());
- $this->assertEquals('mailto:user@example.com', $action->getHref());
- }
- }
|