ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\ContentPage\PageReadingTimeTest Class Reference

Class PageReadingTimeTest. More...

+ Inheritance diagram for ILIAS\ContentPage\PageReadingTimeTest:
+ Collaboration diagram for ILIAS\ContentPage\PageReadingTimeTest:

Public Member Functions

 mixedReadingTypesProvider ()
 
 testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes ($mixedType)
 
 testRawReadingTimeCanBeRetrievedFromValueObject ()
 

Detailed Description

Class PageReadingTimeTest.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 32 of file PageReadingTimeTest.php.

Member Function Documentation

◆ mixedReadingTypesProvider()

ILIAS\ContentPage\PageReadingTimeTest::mixedReadingTypesProvider ( )

Definition at line 34 of file PageReadingTimeTest.php.

34  : array
35  {
36  return [
37  'Float Type' => [4.0],
38  'String Type' => ['4'],
39  'Array Type' => [[4]],
40  'Object Type' => [new stdClass()],
41  'Boolean Type' => [false],
42  'Null Type' => [null],
43  'Ressource Type' => [fopen('php://temp', 'rb')]
44  ];
45  }

◆ testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes()

ILIAS\ContentPage\PageReadingTimeTest::testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes (   $mixedType)
Parameters
mixed$mixedTypemixedReadingTypesProvider

Definition at line 51 of file PageReadingTimeTest.php.

51  : void
52  {
53  $this->expectException(TypeError::class);
54 
55  $readingTime = new PageReadingTime($mixedType);
56  }

◆ testRawReadingTimeCanBeRetrievedFromValueObject()

ILIAS\ContentPage\PageReadingTimeTest::testRawReadingTimeCanBeRetrievedFromValueObject ( )

Definition at line 58 of file PageReadingTimeTest.php.

58  : void
59  {
60  $readingTime = new PageReadingTime(5);
61  $this->assertSame(5, $readingTime->minutes());
62  }

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