ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Glossary\Flashcard\FlashcardManagerTest Class Reference
+ Inheritance diagram for ILIAS\Glossary\Flashcard\FlashcardManagerTest:
+ Collaboration diagram for ILIAS\Glossary\Flashcard\FlashcardManagerTest:

Public Member Functions

 testSetSessionInitialTerms ()
 
 testSetSessionTerms ()
 

Protected Member Functions

 getManagerMock ()
 

Detailed Description

Definition at line 29 of file FlashcardManagerTest.php.

Member Function Documentation

◆ getManagerMock()

ILIAS\Glossary\Flashcard\FlashcardManagerTest::getManagerMock ( )
protected

Definition at line 31 of file FlashcardManagerTest.php.

References $user_id, and ILIAS\__construct().

Referenced by ILIAS\Glossary\Flashcard\FlashcardManagerTest\testSetSessionInitialTerms(), and ILIAS\Glossary\Flashcard\FlashcardManagerTest\testSetSessionTerms().

31  : FlashcardManager
32  {
33  $domain = $this->getMockBuilder(InternalDomainService::class)->disableOriginalConstructor()->getMock();
34  $repo = $this->getMockBuilder(InternalRepoServiceInterface::class)->disableOriginalConstructor()->getMock();
35 
36  return new class ($domain, $repo, 11, 99) extends FlashcardManager {
37  public function __construct(
38  InternalDomainService $domain_service,
39  Glossary\InternalRepoServiceInterface $repo,
40  int $glo_ref_id,
41  int $user_id
42  )
43  {
44  $this->domain = $domain_service;
45  $this->glo_id = $glo_ref_id;
46  $this->user_id = $user_id;
47  $this->session_repo = new FlashcardSessionArrayRepository();
48  }
49  };
50  }
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testSetSessionInitialTerms()

ILIAS\Glossary\Flashcard\FlashcardManagerTest::testSetSessionInitialTerms ( )

Definition at line 52 of file FlashcardManagerTest.php.

References ILIAS\Glossary\Flashcard\FlashcardManagerTest\getManagerMock().

52  : void
53  {
54  $manager = $this->getManagerMock();
55  $terms = [123, 456, 789];
56 
57  $manager->setSessionInitialTerms(55, $terms);
58 
59  $this->assertSame($terms, $manager->getSessionInitialTerms(55));
60  }
+ Here is the call graph for this function:

◆ testSetSessionTerms()

ILIAS\Glossary\Flashcard\FlashcardManagerTest::testSetSessionTerms ( )

Definition at line 62 of file FlashcardManagerTest.php.

References ILIAS\Glossary\Flashcard\FlashcardManagerTest\getManagerMock().

62  : void
63  {
64  $manager = $this->getManagerMock();
65  $terms = [321, 654, 987];
66 
67  $manager->setSessionTerms(77, $terms);
68 
69  $this->assertSame($terms, $manager->getSessionTerms(77));
70  }
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: