ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
TransformationFactoryTest Class Reference

TestCase for the factory of transformations. More...

+ Inheritance diagram for TransformationFactoryTest:
+ Collaboration diagram for TransformationFactoryTest:

Public Member Functions

 testAddLabels ()
 
 testSplitString ()
 
 testCustom ()
 
 testToData ()
 
 testToDataWrongType ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Detailed Description

TestCase for the factory of transformations.

Author
Stefan Hecken stefa.nosp@m.n.he.nosp@m.cken@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de

Definition at line 12 of file TransformationFactoryTest.php.

Member Function Documentation

◆ setUp()

TransformationFactoryTest::setUp ( )
protected

Definition at line 14 of file TransformationFactoryTest.php.

15  {
16  $this->f = new Transformation\Factory();
17  }

◆ tearDown()

TransformationFactoryTest::tearDown ( )
protected

Definition at line 19 of file TransformationFactoryTest.php.

20  {
21  $this->f = null;
22  }

◆ testAddLabels()

TransformationFactoryTest::testAddLabels ( )

Definition at line 24 of file TransformationFactoryTest.php.

25  {
26  $add_label = $this->f->addLabels(array("A", "B", "C"));
27  $this->assertInstanceOf(Transformation\Transformation::class, $add_label);
28  }
A transformation is a function from one datatype to another.

◆ testCustom()

TransformationFactoryTest::testCustom ( )

Definition at line 36 of file TransformationFactoryTest.php.

37  {
38  $custom = $this->f->custom(function () {
39  });
40  $this->assertInstanceOf(Transformation\Transformation::class, $custom);
41  }
A transformation is a function from one datatype to another.

◆ testSplitString()

TransformationFactoryTest::testSplitString ( )

Definition at line 30 of file TransformationFactoryTest.php.

31  {
32  $split_string = $this->f->splitString("#");
33  $this->assertInstanceOf(Transformation\Transformation::class, $split_string);
34  }
A transformation is a function from one datatype to another.

◆ testToData()

TransformationFactoryTest::testToData ( )

Definition at line 43 of file TransformationFactoryTest.php.

References $data.

44  {
45  $data = $this->f->toData('password');
46  $this->assertInstanceOf(Transformation\Transformation::class, $data);
47  }
A transformation is a function from one datatype to another.
$data
Definition: bench.php:6

◆ testToDataWrongType()

TransformationFactoryTest::testToDataWrongType ( )

Definition at line 49 of file TransformationFactoryTest.php.

References $data.

50  {
51  try {
52  $data = $this->f->toData('no_such_type');
53  $this->assertFalse("This should not happen");
54  } catch (\InvalidArgumentException $e) {
55  $this->assertTrue(true);
56  }
57  }
$data
Definition: bench.php:6

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