1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- declare(strict_types=1);
- namespace Test\Avatar;
- use OC\Avatar\GuestAvatar;
- use OCP\Files\SimpleFS\InMemoryFile;
- use PHPUnit\Framework\MockObject\MockObject;
- use Psr\Log\LoggerInterface;
- use Test\TestCase;
- class GuestAvatarTest extends TestCase {
-
- private $guestAvatar;
-
- public function setupGuestAvatar() {
-
- $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
- $this->guestAvatar = new GuestAvatar('einstein', $logger);
- }
-
- public function testGet(): void {
- $this->markTestSkipped('TODO: Disable because fails on drone');
- $avatar = $this->guestAvatar->getFile(32);
- self::assertInstanceOf(InMemoryFile::class, $avatar);
- $expectedFile = file_get_contents(
- __DIR__ . '/../../data/guest_avatar_einstein_32.png'
- );
- self::assertEquals(trim($expectedFile), trim($avatar->getContent()));
- }
-
- public function testIsCustomAvatar(): void {
- self::assertFalse($this->guestAvatar->isCustomAvatar());
- }
- }
|