ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Tests\Setup\Objective\CallableObjectiveTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\Objective\CallableObjectiveTest:
+ Collaboration diagram for ILIAS\Tests\Setup\Objective\CallableObjectiveTest:

Public Member Functions

 myMethod (Setup\Environment $environment)
 
 setUp ()
 
 testGetHash ()
 
 testGetLabel ()
 
 testIsNotable ()
 
 testGetPreconditions ()
 
 testAchieve ()
 

Data Fields

const NAME = "CALL MY METHOD!"
 

Protected Attributes

Setup Environment $env
 
Setup Objective $p
 
Objective CallableObjective $o
 

Detailed Description

Definition at line 30 of file CallableObjectiveTest.php.

Member Function Documentation

◆ myMethod()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::myMethod ( Setup\Environment  $environment)

Definition at line 38 of file CallableObjectiveTest.php.

38 : Setup\Environment
39 {
40 $this->env = $environment;
41 return $environment;
42 }

◆ setUp()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::setUp ( )

Definition at line 46 of file CallableObjectiveTest.php.

46 : void
47 {
48 $this->p = $this->newObjective();
49
50 $this->o = new Objective\CallableObjective(
51 [$this, "myMethod"],
52 self::NAME,
53 false,
54 $this->p
55 );
56 }

◆ testAchieve()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::testAchieve ( )

Definition at line 82 of file CallableObjectiveTest.php.

82 : void
83 {
84 $this->env = null;
85
86 $env = $this->createMock(Setup\Environment::class);
87
88 $res = $this->o->achieve($env);
89 $this->assertSame($env, $res);
90 $this->assertSame($this->env, $env);
91 }
$res
Definition: ltiservices.php:69

References ILIAS\Tests\Setup\Objective\CallableObjectiveTest\$env, and $res.

◆ testGetHash()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::testGetHash ( )

Definition at line 58 of file CallableObjectiveTest.php.

58 : void
59 {
60 $this->assertIsString($this->o->getHash());
61 }

◆ testGetLabel()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::testGetLabel ( )

Definition at line 63 of file CallableObjectiveTest.php.

63 : void
64 {
65 $this->assertEquals(self::NAME, $this->o->getLabel());
66 }

◆ testGetPreconditions()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::testGetPreconditions ( )

Definition at line 73 of file CallableObjectiveTest.php.

73 : void
74 {
75 $env = $this->createMock(Setup\Environment::class);
76
77 $pre = $this->o->getPreconditions($env);
78 $this->assertEquals([$this->p], $pre);
79 }

References ILIAS\Tests\Setup\Objective\CallableObjectiveTest\$env.

◆ testIsNotable()

ILIAS\Tests\Setup\Objective\CallableObjectiveTest::testIsNotable ( )

Definition at line 68 of file CallableObjectiveTest.php.

68 : void
69 {
70 $this->assertFalse($this->o->isNotable());
71 }

Field Documentation

◆ $env

Setup Environment ILIAS\Tests\Setup\Objective\CallableObjectiveTest::$env
protected

◆ $o

Objective CallableObjective ILIAS\Tests\Setup\Objective\CallableObjectiveTest::$o
protected

Definition at line 36 of file CallableObjectiveTest.php.

◆ $p

Setup Objective ILIAS\Tests\Setup\Objective\CallableObjectiveTest::$p
protected

Definition at line 35 of file CallableObjectiveTest.php.

◆ NAME

const ILIAS\Tests\Setup\Objective\CallableObjectiveTest::NAME = "CALL MY METHOD!"

Definition at line 44 of file CallableObjectiveTest.php.


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