Skip to content

Commit 54cb9b1

Browse files
committed
Add new tests
1 parent f24b5bb commit 54cb9b1

File tree

2 files changed

+70
-27
lines changed

2 files changed

+70
-27
lines changed

.idea/workspace.xml

Lines changed: 39 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Javascript/DataTablesScriptTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,35 @@ public function testGetDocumentReady(): void
4646
$this->configuration->setServerSide(false);
4747
$this->assertStringContainsString('var', $this->dataTablesScript->getDocumentReady('test', $this->configuration));
4848
}
49+
50+
public function testGetExternalLibraries1(): void
51+
{
52+
$this->dataTablesScript = new DataTablesScript();
53+
54+
$css = [];
55+
$javascript = [];
56+
57+
$replace = ['css' => false, 'js' => false];
58+
ob_start();
59+
$this->dataTablesScript->getExternalLibraries($css, $javascript, $replace);
60+
$response = ob_get_contents();
61+
ob_end_clean();
62+
echo $response;
63+
$this->expectOutputString($response);
64+
}
65+
66+
public function testGetExternalLibraries2(): void
67+
{
68+
$this->dataTablesScript = new DataTablesScript();
69+
70+
$css = ['test.js'];
71+
$javascript = ['test.css'];
72+
$replace = ['css' => true, 'js' => true];
73+
ob_start();
74+
$this->dataTablesScript->getExternalLibraries($css, $javascript, $replace);
75+
$response = ob_get_contents();
76+
ob_end_clean();
77+
echo $response;
78+
$this->expectOutputString($response);
79+
}
4980
}

0 commit comments

Comments
 (0)