added event for recent activities (#2254)
This commit is contained in:
@@ -26,19 +26,41 @@ class CalendarDragAndDropSourceEventTest extends TestCase
|
||||
|
||||
$sut = new CalendarDragAndDropSourceEvent($user);
|
||||
|
||||
$hello = new TestDragAndDropSource('hello');
|
||||
$tmp1 = new TestDragAndDropSource('foo');
|
||||
$tmp2 = new TestDragAndDropSource('bar');
|
||||
$tmp3 = new TestDragAndDropSource('hello');
|
||||
|
||||
self::assertSame($user, $sut->getUser());
|
||||
self::assertIsArray($sut->getSources());
|
||||
self::assertEmpty($sut->getSources());
|
||||
self::assertInstanceOf(CalendarDragAndDropSourceEvent::class, $sut->addSource(new TestDragAndDropSource()));
|
||||
self::assertCount(1, $sut->getSources());
|
||||
self::assertInstanceOf(CalendarDragAndDropSourceEvent::class, $sut->addSource($tmp1));
|
||||
self::assertInstanceOf(CalendarDragAndDropSourceEvent::class, $sut->addSource($tmp2));
|
||||
self::assertInstanceOf(CalendarDragAndDropSourceEvent::class, $sut->addSource($hello));
|
||||
self::assertInstanceOf(CalendarDragAndDropSourceEvent::class, $sut->addSource($tmp3));
|
||||
self::assertCount(4, $sut->getSources());
|
||||
self::assertEquals([$tmp1, $tmp2, $hello, $tmp3], $sut->getSources());
|
||||
|
||||
self::assertFalse($sut->removeSource(new TestDragAndDropSource('foo')));
|
||||
self::assertTrue($sut->removeSource($hello));
|
||||
self::assertFalse($sut->removeSource(new TestDragAndDropSource('world')));
|
||||
self::assertCount(3, $sut->getSources());
|
||||
self::assertEquals([$tmp1, $tmp2, $tmp3], $sut->getSources());
|
||||
}
|
||||
}
|
||||
|
||||
class TestDragAndDropSource implements DragAndDropSource
|
||||
{
|
||||
private $title;
|
||||
|
||||
public function __construct(string $title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return '';
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getRoute(): string
|
||||
|
||||
Reference in New Issue
Block a user