ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ExcelTestTBD.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
24class ExcelTest extends TestCase
25{
26 protected function setGlobalVariable(string $name, $value): void
27 {
28 global $DIC;
29
30 $GLOBALS[$name] = $value;
31
32 unset($DIC[$name]);
33 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
34 return $value;
35 };
36 }
37
38 protected function setUp(): void
39 {
40 parent::setUp();
42 $GLOBALS['DIC'] = $dic;
43
44 $languageMock = $this->getMockBuilder(ilLanguage::class)
45 ->disableOriginalConstructor()
46 ->getMock();
47 $this->setGlobalVariable(
48 "lng",
49 $languageMock
50 );
51 }
52
53 protected function tearDown(): void
54 {
55 }
56
57 public function testCoordByColumnAndRow(): void
58 {
59 $excel = new ilExcel();
60
61 $this->assertEquals(
62 "C2",
63 $excel->getCoordByColumnAndRow(2, 2)
64 );
65 }
66}
testCoordByColumnAndRow()
setGlobalVariable(string $name, $value)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
$c
Definition: deliver.php:25
$dic
Definition: ltiresult.php:33
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54