ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Tests\Setup\Objective\MigrationObjectiveTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\Objective\MigrationObjectiveTest:
+ Collaboration diagram for ILIAS\Tests\Setup\Objective\MigrationObjectiveTest:

Public Member Functions

 testMigrationWithoutRemainingStepsIsNotApplicableAndTellsWhy ()
 
 testMigrationWithRemainingStepsIsApplicable ()
 
 testMigrationWithoutRemainingStepsAndWithoutInteraction ()
 

Private Member Functions

 getMigration (int $remaining_steps)
 

Detailed Description

Definition at line 27 of file MigrationObjectiveTest.php.

Member Function Documentation

◆ getMigration()

ILIAS\Tests\Setup\Objective\MigrationObjectiveTest::getMigration ( int  $remaining_steps)
private

Definition at line 67 of file MigrationObjectiveTest.php.

67 : Setup\Migration
68 {
69 $migration = $this->createMock(Setup\Migration::class);
70 $migration->expects($this->once())
71 ->method('prepare');
72 $migration->method('getRemainingAmountOfSteps')
73 ->willReturn($remaining_steps);
74 $migration->method('getDefaultAmountOfStepsPerRun')
75 ->willReturn(1);
76
77 return $migration;
78 }

Referenced by ILIAS\Tests\Setup\Objective\MigrationObjectiveTest\testMigrationWithoutRemainingStepsAndWithoutInteraction(), ILIAS\Tests\Setup\Objective\MigrationObjectiveTest\testMigrationWithoutRemainingStepsIsNotApplicableAndTellsWhy(), and ILIAS\Tests\Setup\Objective\MigrationObjectiveTest\testMigrationWithRemainingStepsIsApplicable().

+ Here is the caller graph for this function:

◆ testMigrationWithoutRemainingStepsAndWithoutInteraction()

ILIAS\Tests\Setup\Objective\MigrationObjectiveTest::testMigrationWithoutRemainingStepsAndWithoutInteraction ( )

Definition at line 60 of file MigrationObjectiveTest.php.

60 : void
61 {
62 $objective = new Objective\MigrationObjective($this->getMigration(0));
63
64 $this->assertFalse($objective->isApplicable(new Setup\ArrayEnvironment([])));
65 }

References ILIAS\Tests\Setup\Objective\MigrationObjectiveTest\getMigration().

+ Here is the call graph for this function:

◆ testMigrationWithoutRemainingStepsIsNotApplicableAndTellsWhy()

ILIAS\Tests\Setup\Objective\MigrationObjectiveTest::testMigrationWithoutRemainingStepsIsNotApplicableAndTellsWhy ( )

Definition at line 29 of file MigrationObjectiveTest.php.

29 : void
30 {
31 $migration = $this->getMigration(0);
32 $io = $this->createMock(Setup\AdminInteraction::class);
33 $io->expects($this->once())
34 ->method('inform')
35 ->with($this->stringContains('has no remaining steps left'));
36
37 $objective = new Objective\MigrationObjective($migration);
38 $environment = new Setup\ArrayEnvironment([
40 ]);
41
42 $this->assertFalse($objective->isApplicable($environment));
43 }

References ILIAS\Tests\Setup\Objective\MigrationObjectiveTest\getMigration(), and ILIAS\Setup\Environment\RESOURCE_ADMIN_INTERACTION.

+ Here is the call graph for this function:

◆ testMigrationWithRemainingStepsIsApplicable()

ILIAS\Tests\Setup\Objective\MigrationObjectiveTest::testMigrationWithRemainingStepsIsApplicable ( )

Definition at line 45 of file MigrationObjectiveTest.php.

45 : void
46 {
47 $migration = $this->getMigration(3);
48 $io = $this->createMock(Setup\AdminInteraction::class);
49 $io->expects($this->never())
50 ->method('inform');
51
52 $objective = new Objective\MigrationObjective($migration);
53 $environment = new Setup\ArrayEnvironment([
55 ]);
56
57 $this->assertTrue($objective->isApplicable($environment));
58 }

References ILIAS\Tests\Setup\Objective\MigrationObjectiveTest\getMigration(), and ILIAS\Setup\Environment\RESOURCE_ADMIN_INTERACTION.

+ Here is the call graph for this function:

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