added avatars, show user teams in list, new team dashboard widgets (#1150)
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Entity\User;
|
||||
use App\Repository\TimesheetRepository;
|
||||
use App\Repository\WidgetRepository;
|
||||
use App\Tests\Mocks\Security\CurrentUserFactory;
|
||||
use App\Widget\Type\CompoundChart;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -46,7 +47,7 @@ class WidgetRepositoryTest extends TestCase
|
||||
|
||||
/**
|
||||
* @expectedException \App\Widget\WidgetException
|
||||
* @expectedExceptionMessage Unknown widget type "\App\Widget\Type\FooBar"
|
||||
* @expectedExceptionMessage Unknown widget type "FooBar"
|
||||
*/
|
||||
public function testGetWidgetThrowsExceptionOnInvalidType()
|
||||
{
|
||||
@@ -59,14 +60,14 @@ class WidgetRepositoryTest extends TestCase
|
||||
|
||||
/**
|
||||
* @expectedException \App\Widget\WidgetException
|
||||
* @expectedExceptionMessage Invalid widget type "\App\Widget\Type\CompoundChart" does not extend AbstractWidgetType
|
||||
* @expectedExceptionMessage Widget type "App\Widget\Type\CompoundChart" is not an instance of "App\Widget\Type\AbstractWidgetType"
|
||||
*/
|
||||
public function testGetWidgetTriggersExceptionOnWrongClass()
|
||||
{
|
||||
$repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
|
||||
$userMock = (new CurrentUserFactory($this))->create(new User());
|
||||
|
||||
$sut = new WidgetRepository($repoMock, $userMock, ['test' => ['type' => 'CompoundChart', 'user' => false]]);
|
||||
$sut = new WidgetRepository($repoMock, $userMock, ['test' => ['type' => CompoundChart::class, 'user' => false]]);
|
||||
$sut->get('test');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user