Skip to content

Commit

Permalink
gothub test files
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko9827 committed Dec 14, 2021
1 parent 0375dcc commit 8dc54e3
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Minify JS, CSS, HTML string or file.

# Usage
```php
use marko9827/minify;
use marko9827\minify;

$content = file_get_contents("$path/file.example"); // .example = .js/.css/.html
// or
Expand Down
17 changes: 17 additions & 0 deletions src/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

include "./vendor/autoload.php";

use marko9827\minify;

$content = file_get_contents("$path/file.example"); // .example = .js/.css/.html
// or
$content = "var a = 0; return a + 2;"; //js example
$content = "body { display: flex; }"; // css example
$content = "... <body> <div id='example_div'><p>Html Example</p></div> ..."; // html example

$minify = new Minify($content);
echo $minify;


?>
20 changes: 20 additions & 0 deletions src/test/test.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
* {
margin: 0px;
padding: 0px;
}

body {
display: flex;
height: 100%;
width: 100%;
}

div {
display: block;
margin: auto;
padding: 40px;
font-size: xxx-large;
font-family: arial;
color: #333;
text-align: center;
}
18 changes: 18 additions & 0 deletions src/test/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
<title>Test</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width">
<meta name="description" content="Page for PhpMinify testing">
<style type="text/css">
@import url(./test.css);
</style>
</head>

<body>
<script src="test.js"></script>
</body>

</html>
8 changes: 8 additions & 0 deletions src/test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var clock = document.createElement("div"),
date = new Date();

function Clock() {
clock.innerHTML = `- DIGITAL CLOCK - <br>${date.getHours()}:${date.getMinutes()}:${new Date().getSeconds()}`;
}
document.body.appendChild(clock);
setInterval(Clock, 1000);

0 comments on commit 8dc54e3

Please sign in to comment.