ILIAS  release_8 Revision v8.24
ExcelTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
8class ExcelTest extends TestCase
9{
10 protected function setGlobalVariable(string $name, $value): void
11 {
12 global $DIC;
13
14 $GLOBALS[$name] = $value;
15
16 unset($DIC[$name]);
17 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
18 return $value;
19 };
20 }
21
22 protected function setUp(): void
23 {
24 parent::setUp();
26 $GLOBALS['DIC'] = $dic;
27
28 $languageMock = $this->getMockBuilder(ilLanguage::class)
29 ->disableOriginalConstructor()
30 ->getMock();
31 $this->setGlobalVariable(
32 "lng",
33 $languageMock
34 );
35 }
36
37 protected function tearDown(): void
38 {
39 }
40
41 public function testCoordByColumnAndRow(): void
42 {
43 $excel = new ilExcel();
44
45 $this->assertEquals(
46 "C2",
47 $excel->getCoordByColumnAndRow(2, 2)
48 );
49 }
50}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
testCoordByColumnAndRow()
Definition: ExcelTest.php:41
setGlobalVariable(string $name, $value)
Definition: ExcelTest.php:10
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
$dic
Definition: result.php:32