@@ -1,6 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | interface ConnectionAdapterInterface { |
3 | + |
|
4 | + /** |
|
5 | + * @return void |
|
6 | + */ |
|
3 | 7 | public function __construct( $_srv, $_db, $_usr, $_pass); |
8 | + |
|
9 | + /** |
|
10 | + * @return boolean |
|
11 | + */ |
|
4 | 12 | public function query( $_query ); |
5 | 13 | public function queryFetch( $_query ); |
6 | 14 | public function queryArray( $_query ); |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | interface ConnectionAdapterInterface { |
3 | - public function __construct( $_srv, $_db, $_usr, $_pass); |
|
4 | - public function query( $_query ); |
|
5 | - public function queryFetch( $_query ); |
|
6 | - public function queryArray( $_query ); |
|
7 | - public function queryInsert( $_query ); |
|
3 | + public function __construct($_srv, $_db, $_usr, $_pass); |
|
4 | + public function query($_query); |
|
5 | + public function queryFetch($_query); |
|
6 | + public function queryArray($_query); |
|
7 | + public function queryInsert($_query); |
|
8 | 8 | } |
9 | 9 | ?> |
@@ -39,6 +39,10 @@ discard block |
||
39 | 39 | array_push($temp,$i); |
40 | 40 | return $temp; |
41 | 41 | } |
42 | + |
|
43 | + /** |
|
44 | + * @param string $_mods |
|
45 | + */ |
|
42 | 46 | public function addModules( $_mods ) { |
43 | 47 | if(!is_array($_mods)) |
44 | 48 | throw new InvalidArgumentException("Parameter must be an array."); |
@@ -64,6 +68,10 @@ discard block |
||
64 | 68 | throw new InvalidArgumentException("Parameter must be a string or an array."); |
65 | 69 | array_push($this->files, $_file); |
66 | 70 | } |
71 | + |
|
72 | + /** |
|
73 | + * @param string $_files |
|
74 | + */ |
|
67 | 75 | public function addFilesRequired( $_files ) { |
68 | 76 | if(!is_array($_files)) |
69 | 77 | throw new InvalidArgumentException("Parameter must be an array."); |
@@ -80,6 +88,11 @@ discard block |
||
80 | 88 | $this->tags["js"] = $this->getJs(); |
81 | 89 | $this->tags["jsVariables"] = $this->getJsVariables(); |
82 | 90 | } |
91 | + |
|
92 | + /** |
|
93 | + * @param string $_function |
|
94 | + * @param string $_extenction |
|
95 | + */ |
|
83 | 96 | protected function getRequire( $_function, $_extenction) { |
84 | 97 | $temp = []; |
85 | 98 | foreach ($this->required as $i) |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | public $parameters; |
11 | 11 | public function __construct() { |
12 | 12 | $this->name = get_class($this); |
13 | - $this->modules = []; |
|
13 | + $this->modules = []; |
|
14 | 14 | $this->files = []; |
15 | - $this->required = []; |
|
15 | + $this->required = []; |
|
16 | 16 | $this->data = []; |
17 | 17 | $this->tags = []; |
18 | 18 | $this->connection = null; |
@@ -22,56 +22,56 @@ discard block |
||
22 | 22 | // abstract public function init(); |
23 | 23 | // abstract public function draw(); |
24 | 24 | public function getCss() { |
25 | - return $this->getRequire("getCss",".css"); |
|
25 | + return $this->getRequire("getCss", ".css"); |
|
26 | 26 | } |
27 | 27 | public function getJs() { |
28 | - return $this->getRequire("getJs",".js"); |
|
28 | + return $this->getRequire("getJs", ".js"); |
|
29 | 29 | } |
30 | 30 | public function getJsVariables() { |
31 | 31 | $temp = []; |
32 | 32 | foreach ($this->required as $i) |
33 | 33 | if (is_array($i)) |
34 | - array_push($temp,$i); |
|
34 | + array_push($temp, $i); |
|
35 | 35 | foreach ($this->modules as $i) |
36 | - $temp = array_merge( $temp, $i->getJsVariables() ); |
|
36 | + $temp = array_merge($temp, $i->getJsVariables()); |
|
37 | 37 | foreach ($this->files as $i) |
38 | 38 | if (is_array($i)) |
39 | - array_push($temp,$i); |
|
39 | + array_push($temp, $i); |
|
40 | 40 | return $temp; |
41 | 41 | } |
42 | - public function addModules( $_mods ) { |
|
43 | - if(!is_array($_mods)) |
|
42 | + public function addModules($_mods) { |
|
43 | + if (!is_array($_mods)) |
|
44 | 44 | throw new InvalidArgumentException("Parameter must be an array."); |
45 | 45 | foreach ($_mods as $value) |
46 | 46 | $this->addModule($value); |
47 | 47 | } |
48 | - public function addModule( $_mod ) { |
|
49 | - if(!is_object($_mod)) |
|
48 | + public function addModule($_mod) { |
|
49 | + if (!is_object($_mod)) |
|
50 | 50 | throw new InvalidArgumentException("Parameter must be a class."); |
51 | - if(! is_subclass_of ($_mod, "Module")) |
|
51 | + if (!is_subclass_of($_mod, "Module")) |
|
52 | 52 | throw new InvalidArgumentException("Parameter must be a class."); |
53 | 53 | $this->modules[$_mod->name] = $_mod; |
54 | 54 | $this->modules[$_mod->name]->parameters = &$this->parameters; |
55 | 55 | } |
56 | - public function addFiles( $_files ) { |
|
57 | - if(!is_array($_files)) |
|
56 | + public function addFiles($_files) { |
|
57 | + if (!is_array($_files)) |
|
58 | 58 | throw new InvalidArgumentException("Parameter must be an array."); |
59 | 59 | foreach ($_files as $value) |
60 | 60 | $this->addFile($value); |
61 | 61 | } |
62 | - public function addFile( $_file ) { |
|
63 | - if(!(is_string($_file) || is_array($_file))) |
|
62 | + public function addFile($_file) { |
|
63 | + if (!(is_string($_file) || is_array($_file))) |
|
64 | 64 | throw new InvalidArgumentException("Parameter must be a string or an array."); |
65 | 65 | array_push($this->files, $_file); |
66 | 66 | } |
67 | - public function addFilesRequired( $_files ) { |
|
68 | - if(!is_array($_files)) |
|
67 | + public function addFilesRequired($_files) { |
|
68 | + if (!is_array($_files)) |
|
69 | 69 | throw new InvalidArgumentException("Parameter must be an array."); |
70 | 70 | foreach ($_files as $value) |
71 | 71 | $this->addFileRequired($value); |
72 | 72 | } |
73 | - public function addFileRequired( $_file ) { |
|
74 | - if(!is_string($_file)) |
|
73 | + public function addFileRequired($_file) { |
|
74 | + if (!is_string($_file)) |
|
75 | 75 | throw new InvalidArgumentException("Parameter must be a string."); |
76 | 76 | array_push($this->required, $_file); |
77 | 77 | } |
@@ -80,16 +80,16 @@ discard block |
||
80 | 80 | $this->tags["js"] = $this->getJs(); |
81 | 81 | $this->tags["jsVariables"] = $this->getJsVariables(); |
82 | 82 | } |
83 | - protected function getRequire( $_function, $_extenction) { |
|
83 | + protected function getRequire($_function, $_extenction) { |
|
84 | 84 | $temp = []; |
85 | 85 | foreach ($this->required as $i) |
86 | 86 | if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
87 | - array_push($temp,$i); |
|
87 | + array_push($temp, $i); |
|
88 | 88 | foreach ($this->modules as $i) |
89 | - $temp = array_merge( $temp, $i->$_function() ); |
|
89 | + $temp = array_merge($temp, $i->$_function()); |
|
90 | 90 | foreach ($this->files as $i) |
91 | 91 | if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
92 | - array_push($temp,$i); |
|
92 | + array_push($temp, $i); |
|
93 | 93 | return $temp; |
94 | 94 | } |
95 | 95 | } |
@@ -29,50 +29,63 @@ discard block |
||
29 | 29 | } |
30 | 30 | public function getJsVariables() { |
31 | 31 | $temp = []; |
32 | - foreach ($this->required as $i) |
|
33 | - if (is_array($i)) |
|
32 | + foreach ($this->required as $i) { |
|
33 | + if (is_array($i)) |
|
34 | 34 | array_push($temp,$i); |
35 | - foreach ($this->modules as $i) |
|
36 | - $temp = array_merge( $temp, $i->getJsVariables() ); |
|
37 | - foreach ($this->files as $i) |
|
38 | - if (is_array($i)) |
|
35 | + } |
|
36 | + foreach ($this->modules as $i) { |
|
37 | + $temp = array_merge( $temp, $i->getJsVariables() ); |
|
38 | + } |
|
39 | + foreach ($this->files as $i) { |
|
40 | + if (is_array($i)) |
|
39 | 41 | array_push($temp,$i); |
42 | + } |
|
40 | 43 | return $temp; |
41 | 44 | } |
42 | 45 | public function addModules( $_mods ) { |
43 | - if(!is_array($_mods)) |
|
44 | - throw new InvalidArgumentException("Parameter must be an array."); |
|
45 | - foreach ($_mods as $value) |
|
46 | - $this->addModule($value); |
|
46 | + if(!is_array($_mods)) { |
|
47 | + throw new InvalidArgumentException("Parameter must be an array."); |
|
48 | + } |
|
49 | + foreach ($_mods as $value) { |
|
50 | + $this->addModule($value); |
|
51 | + } |
|
47 | 52 | } |
48 | 53 | public function addModule( $_mod ) { |
49 | - if(!is_object($_mod)) |
|
50 | - throw new InvalidArgumentException("Parameter must be a class."); |
|
51 | - if(! is_subclass_of ($_mod, "Module")) |
|
52 | - throw new InvalidArgumentException("Parameter must be a class."); |
|
54 | + if(!is_object($_mod)) { |
|
55 | + throw new InvalidArgumentException("Parameter must be a class."); |
|
56 | + } |
|
57 | + if(! is_subclass_of ($_mod, "Module")) { |
|
58 | + throw new InvalidArgumentException("Parameter must be a class."); |
|
59 | + } |
|
53 | 60 | $this->modules[$_mod->name] = $_mod; |
54 | 61 | $this->modules[$_mod->name]->parameters = &$this->parameters; |
55 | 62 | } |
56 | 63 | public function addFiles( $_files ) { |
57 | - if(!is_array($_files)) |
|
58 | - throw new InvalidArgumentException("Parameter must be an array."); |
|
59 | - foreach ($_files as $value) |
|
60 | - $this->addFile($value); |
|
64 | + if(!is_array($_files)) { |
|
65 | + throw new InvalidArgumentException("Parameter must be an array."); |
|
66 | + } |
|
67 | + foreach ($_files as $value) { |
|
68 | + $this->addFile($value); |
|
69 | + } |
|
61 | 70 | } |
62 | 71 | public function addFile( $_file ) { |
63 | - if(!(is_string($_file) || is_array($_file))) |
|
64 | - throw new InvalidArgumentException("Parameter must be a string or an array."); |
|
72 | + if(!(is_string($_file) || is_array($_file))) { |
|
73 | + throw new InvalidArgumentException("Parameter must be a string or an array."); |
|
74 | + } |
|
65 | 75 | array_push($this->files, $_file); |
66 | 76 | } |
67 | 77 | public function addFilesRequired( $_files ) { |
68 | - if(!is_array($_files)) |
|
69 | - throw new InvalidArgumentException("Parameter must be an array."); |
|
70 | - foreach ($_files as $value) |
|
71 | - $this->addFileRequired($value); |
|
78 | + if(!is_array($_files)) { |
|
79 | + throw new InvalidArgumentException("Parameter must be an array."); |
|
80 | + } |
|
81 | + foreach ($_files as $value) { |
|
82 | + $this->addFileRequired($value); |
|
83 | + } |
|
72 | 84 | } |
73 | 85 | public function addFileRequired( $_file ) { |
74 | - if(!is_string($_file)) |
|
75 | - throw new InvalidArgumentException("Parameter must be a string."); |
|
86 | + if(!is_string($_file)) { |
|
87 | + throw new InvalidArgumentException("Parameter must be a string."); |
|
88 | + } |
|
76 | 89 | array_push($this->required, $_file); |
77 | 90 | } |
78 | 91 | protected function addDipendences() { |
@@ -82,14 +95,17 @@ discard block |
||
82 | 95 | } |
83 | 96 | protected function getRequire( $_function, $_extenction) { |
84 | 97 | $temp = []; |
85 | - foreach ($this->required as $i) |
|
86 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
98 | + foreach ($this->required as $i) { |
|
99 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
87 | 100 | array_push($temp,$i); |
88 | - foreach ($this->modules as $i) |
|
89 | - $temp = array_merge( $temp, $i->$_function() ); |
|
90 | - foreach ($this->files as $i) |
|
91 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
101 | + } |
|
102 | + foreach ($this->modules as $i) { |
|
103 | + $temp = array_merge( $temp, $i->$_function() ); |
|
104 | + } |
|
105 | + foreach ($this->files as $i) { |
|
106 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
92 | 107 | array_push($temp,$i); |
108 | + } |
|
93 | 109 | return $temp; |
94 | 110 | } |
95 | 111 | } |
@@ -8,20 +8,20 @@ discard block |
||
8 | 8 | parent::__construct(); |
9 | 9 | $args = func_get_args(); |
10 | 10 | $count = func_num_args(); |
11 | - if (method_exists($this,$func='__construct'.$count)) |
|
12 | - call_user_func_array(array($this,$func),$args); |
|
11 | + if (method_exists($this, $func = '__construct'.$count)) |
|
12 | + call_user_func_array(array($this, $func), $args); |
|
13 | 13 | } |
14 | 14 | public function __construct0() { |
15 | 15 | $this->database = null; |
16 | 16 | } |
17 | - public function __construct4 ( $_srv, $_db, $_usr, $_pass ) { |
|
17 | + public function __construct4($_srv, $_db, $_usr, $_pass) { |
|
18 | 18 | $this->setConnection($_srv, $_db, $_usr, $_pass, "pdo"); |
19 | 19 | } |
20 | - public function __construct5 ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
20 | + public function __construct5($_srv, $_db, $_usr, $_pass, $_type) { |
|
21 | 21 | $type = $this->getConnectionType($_type); |
22 | 22 | $this->setConnection($_srv, $_db, $_usr, $_pass, $type); |
23 | 23 | } |
24 | - protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
24 | + protected function setConnection($_srv, $_db, $_usr, $_pass, $_type) { |
|
25 | 25 | switch ($_type) { |
26 | 26 | case "mysqli": |
27 | 27 | $this->database = new ConnectionMysqliAdapter($_srv, $_db, $_usr, $_pass); |
@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | $this->database = new ConnectionPdoAdapter($_srv, $_db, $_usr, $_pass); |
31 | 31 | break; |
32 | 32 | } |
33 | - $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass); |
|
33 | + $this->setConnectionParameters($_srv, $_db, $_usr, $_pass); |
|
34 | 34 | } |
35 | - protected function getConnectionType( $_type ) { |
|
35 | + protected function getConnectionType($_type) { |
|
36 | 36 | foreach ($_type as $key => $value) |
37 | - if($value) |
|
37 | + if ($value) |
|
38 | 38 | return $key; |
39 | 39 | return "pdo"; |
40 | 40 | } |
41 | - protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) { |
|
41 | + protected function setConnectionParameters($_srv, $_db, $_usr, $_pass) { |
|
42 | 42 | $this->info = []; |
43 | - $this->info["server"] = $_srv; |
|
43 | + $this->info["server"] = $_srv; |
|
44 | 44 | $this->info["database"] = $_db; |
45 | - $this->info["user"] = $_usr; |
|
45 | + $this->info["user"] = $_usr; |
|
46 | 46 | $this->info["password"] = $_pass; |
47 | 47 | } |
48 | 48 | } |
@@ -8,8 +8,9 @@ discard block |
||
8 | 8 | parent::__construct(); |
9 | 9 | $args = func_get_args(); |
10 | 10 | $count = func_num_args(); |
11 | - if (method_exists($this,$func='__construct'.$count)) |
|
12 | - call_user_func_array(array($this,$func),$args); |
|
11 | + if (method_exists($this,$func='__construct'.$count)) { |
|
12 | + call_user_func_array(array($this,$func),$args); |
|
13 | + } |
|
13 | 14 | } |
14 | 15 | public function __construct0() { |
15 | 16 | $this->database = null; |
@@ -33,9 +34,10 @@ discard block |
||
33 | 34 | $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass); |
34 | 35 | } |
35 | 36 | protected function getConnectionType( $_type ) { |
36 | - foreach ($_type as $key => $value) |
|
37 | - if($value) |
|
37 | + foreach ($_type as $key => $value) { |
|
38 | + if($value) |
|
38 | 39 | return $key; |
40 | + } |
|
39 | 41 | return "pdo"; |
40 | 42 | } |
41 | 43 | protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) { |
@@ -2,36 +2,36 @@ |
||
2 | 2 | jRequire("ConnectionInterface.php"); |
3 | 3 | class ConnectionMysqliAdapter implements ConnectionAdapterInterface { |
4 | 4 | public $connection; |
5 | - public function __construct( $_srv, $_db, $_usr, $_pass ) { |
|
6 | - $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db ); |
|
5 | + public function __construct($_srv, $_db, $_usr, $_pass) { |
|
6 | + $this->connection = new mysqli($_srv, $_usr, $_pass, $_db); |
|
7 | 7 | } |
8 | - public function query( $_query ) { |
|
8 | + public function query($_query) { |
|
9 | 9 | $this->stdQuery($_query); |
10 | 10 | return true; |
11 | 11 | } |
12 | - public function queryInsert( $_query ) { |
|
12 | + public function queryInsert($_query) { |
|
13 | 13 | $this->stdQuery($_query); |
14 | 14 | return $this->connection->insert_id; |
15 | 15 | } |
16 | - public function queryFetch( $_query ) { |
|
16 | + public function queryFetch($_query) { |
|
17 | 17 | $result = $this->stdQuery($_query); |
18 | 18 | $rows = []; |
19 | - while($row = $result->fetch_assoc()) |
|
19 | + while ($row = $result->fetch_assoc()) |
|
20 | 20 | $rows[] = $row; |
21 | 21 | return $rows; |
22 | 22 | } |
23 | - public function queryArray( $_query ) { |
|
23 | + public function queryArray($_query) { |
|
24 | 24 | $result = $this->stdQuery($_query); |
25 | 25 | $rows = []; |
26 | - while($row = $result->fetch_array()) |
|
26 | + while ($row = $result->fetch_array()) |
|
27 | 27 | $rows[] = $row; |
28 | 28 | return $rows; |
29 | 29 | } |
30 | - protected function stdQuery( $_query ) { |
|
30 | + protected function stdQuery($_query) { |
|
31 | 31 | $database = $this->connection; |
32 | 32 | $error = "Error query [$_query]"; |
33 | 33 | $result = $database->query($_query); |
34 | - if(!$result) { |
|
34 | + if (!$result) { |
|
35 | 35 | echo "$_query<br>"; |
36 | 36 | echo "Something wrong: $error"; |
37 | 37 | var_dump($database->error); |
@@ -16,15 +16,17 @@ |
||
16 | 16 | public function queryFetch( $_query ) { |
17 | 17 | $result = $this->stdQuery($_query); |
18 | 18 | $rows = []; |
19 | - while($row = $result->fetch_assoc()) |
|
20 | - $rows[] = $row; |
|
19 | + while($row = $result->fetch_assoc()) { |
|
20 | + $rows[] = $row; |
|
21 | + } |
|
21 | 22 | return $rows; |
22 | 23 | } |
23 | 24 | public function queryArray( $_query ) { |
24 | 25 | $result = $this->stdQuery($_query); |
25 | 26 | $rows = []; |
26 | - while($row = $result->fetch_array()) |
|
27 | - $rows[] = $row; |
|
27 | + while($row = $result->fetch_array()) { |
|
28 | + $rows[] = $row; |
|
29 | + } |
|
28 | 30 | return $rows; |
29 | 31 | } |
30 | 32 | protected function stdQuery( $_query ) { |
@@ -2,32 +2,32 @@ |
||
2 | 2 | jRequire("ConnectionInterface.php"); |
3 | 3 | class ConnectionPdoAdapter implements ConnectionAdapterInterface { |
4 | 4 | public $connection; |
5 | - public function __construct( $_srv, $_db, $_usr, $_pass ) { |
|
5 | + public function __construct($_srv, $_db, $_usr, $_pass) { |
|
6 | 6 | $connection = "mysql:host=$_srv;dbname=$_db"; |
7 | - $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] ); |
|
7 | + $this->connection = new PDO($connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"]); |
|
8 | 8 | } |
9 | - public function query( $_query ) { |
|
9 | + public function query($_query) { |
|
10 | 10 | $this->stdQuery($_query); |
11 | 11 | return true; |
12 | 12 | } |
13 | - public function queryInsert( $_query ) { |
|
13 | + public function queryInsert($_query) { |
|
14 | 14 | $this->stdQuery($_query); |
15 | 15 | return $this->connection->lastInsertId(); |
16 | 16 | } |
17 | - public function queryFetch( $_query ) { |
|
17 | + public function queryFetch($_query) { |
|
18 | 18 | $temp = $this->stdQuery($_query); |
19 | 19 | return $temp->fetchAll(PDO::FETCH_ASSOC); |
20 | 20 | } |
21 | - public function queryArray( $_query ) { |
|
21 | + public function queryArray($_query) { |
|
22 | 22 | $temp = $this->stdQuery($_query); |
23 | 23 | return $temp->fetchAll(PDO::FETCH_COLUMN, 0); |
24 | 24 | } |
25 | - protected function stdQuery( $_query ) { |
|
25 | + protected function stdQuery($_query) { |
|
26 | 26 | $database = $this->connection; |
27 | 27 | $error = "Error query [$_query]"; |
28 | 28 | $query = $database->prepare($_query); |
29 | 29 | $result = $query->execute(); |
30 | - if(!$result) { |
|
30 | + if (!$result) { |
|
31 | 31 | echo "$_query<br>"; |
32 | 32 | echo "Something wrong: $error"; |
33 | 33 | var_dump($query->errorInfo()); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - declare( strict_types = 1 ); |
|
2 | + declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | use PHPUnit\Framework\TestCase; |
5 | 5 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function testAddModuleNoModule() { |
33 | 33 | $this->expectException(InvalidArgumentException::class); |
34 | 34 | $module = new Module(); |
35 | - $module->addModule((object)[1,2,3]); |
|
35 | + $module->addModule((object) [1, 2, 3]); |
|
36 | 36 | } |
37 | 37 | public function testAddModules() { |
38 | 38 | $this->expectException(InvalidArgumentException::class); |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | } |
42 | 42 | public function testGetCss() { |
43 | 43 | $module = new Module(); |
44 | - $module->addFiles(["1.css","2.js","3.css","4.js"]); |
|
45 | - $this->assertEquals(["1.css","3.css"], $module->getCss()); |
|
44 | + $module->addFiles(["1.css", "2.js", "3.css", "4.js"]); |
|
45 | + $this->assertEquals(["1.css", "3.css"], $module->getCss()); |
|
46 | 46 | } |
47 | 47 | public function testGetJs() { |
48 | 48 | $module = new Module(); |
49 | - $module->addFiles(["1.css","2.js","3.css","4.js"]); |
|
50 | - $this->assertEquals(["2.js","4.js"], $module->getJs()); |
|
49 | + $module->addFiles(["1.css", "2.js", "3.css", "4.js"]); |
|
50 | + $this->assertEquals(["2.js", "4.js"], $module->getJs()); |
|
51 | 51 | } |
52 | 52 | public function testGetJsVariables() { |
53 | 53 | $module = new Module(); |
54 | - $module->addFiles(["1.css",["variable","2"],"3.css","4.js"]); |
|
55 | - $this->assertEquals([["variable","2"]], $module->getJsVariables()); |
|
54 | + $module->addFiles(["1.css", ["variable", "2"], "3.css", "4.js"]); |
|
55 | + $this->assertEquals([["variable", "2"]], $module->getJsVariables()); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | ?> |