ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ExcelTestTBD.php
Go to the documentation of this file.
1 <?php
2 
20 
24 class 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();
41  $dic = new ILIAS\DI\Container();
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 }
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22
testCoordByColumnAndRow()
setGlobalVariable(string $name, $value)
$dic
Definition: result.php:31