Browse Source

Add 'include' & 'require' statements test.

master
Rafal Kupiec 7 months ago
parent
commit
0e757111a3
Signed by: belliash <belliash@codingworkshop.eu.org> GPG Key ID: 4E829243E0CFE6B4
5 changed files with 29 additions and 0 deletions
  1. +8
    -0
      tests/data/includes/base_class.aer
  2. +1
    -0
      tests/data/includes/include_test.aer
  3. +3
    -0
      tests/data/includes/test_class.aer
  4. +12
    -0
      tests/include_statements.aer
  5. +5
    -0
      tests/include_statements.exp

+ 8
- 0
tests/data/includes/base_class.aer View File

@@ -0,0 +1,8 @@
class BaseClass {

protected void run() {
printf('Test launched...');
include 'data/includes/include_test.aer';
}

}

+ 1
- 0
tests/data/includes/include_test.aer View File

@@ -0,0 +1 @@
printf("OK!\n");

+ 3
- 0
tests/data/includes/test_class.aer View File

@@ -0,0 +1,3 @@
class Test {
string $test = 'This is a test';
}

+ 12
- 0
tests/include_statements.aer View File

@@ -0,0 +1,12 @@
require 'data/includes/base_class.aer';

class Program extends BaseClass {

void main() {
$this->run();
require 'data/includes/test_class.aer';
object $test = new Test();
var_dump($test);
}

}

+ 5
- 0
tests/include_statements.exp View File

@@ -0,0 +1,5 @@
Test launched...OK!
object(Test) {
['test'] =>
string(14 'This is a test')
}

Loading…
Cancel
Save