Skip to content

Commit

Permalink
Add new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atsanna committed Mar 15, 2024
1 parent f24b5bb commit 54cb9b1
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 27 deletions.
66 changes: 39 additions & 27 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions tests/Javascript/DataTablesScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,35 @@ public function testGetDocumentReady(): void
$this->configuration->setServerSide(false);
$this->assertStringContainsString('var', $this->dataTablesScript->getDocumentReady('test', $this->configuration));
}

public function testGetExternalLibraries1(): void
{
$this->dataTablesScript = new DataTablesScript();

$css = [];
$javascript = [];

$replace = ['css' => false, 'js' => false];
ob_start();
$this->dataTablesScript->getExternalLibraries($css, $javascript, $replace);
$response = ob_get_contents();
ob_end_clean();
echo $response;
$this->expectOutputString($response);
}

public function testGetExternalLibraries2(): void
{
$this->dataTablesScript = new DataTablesScript();

$css = ['test.js'];
$javascript = ['test.css'];
$replace = ['css' => true, 'js' => true];
ob_start();
$this->dataTablesScript->getExternalLibraries($css, $javascript, $replace);
$response = ob_get_contents();
ob_end_clean();
echo $response;
$this->expectOutputString($response);
}
}

0 comments on commit 54cb9b1

Please sign in to comment.