Search in sources :

Example 51 with Memory

use of php.runtime.Memory in project jphp by jphp-compiler.

the class UserFunctionTest method testArrayReferenceDefault.

@Test
public void testArrayReferenceDefault() {
    Memory memory = includeResource("user_function/with_reference_default.php");
    Assert.assertEquals(100520, memory.toLong());
}
Also used : Memory(php.runtime.Memory) ArrayMemory(php.runtime.memory.ArrayMemory) Test(org.junit.Test)

Example 52 with Memory

use of php.runtime.Memory in project jphp by jphp-compiler.

the class UserFunctionTest method testWithConstDefault.

@Test
public void testWithConstDefault() {
    Memory memory = includeResource("user_function/with_const_default.php");
    Assert.assertEquals("success", memory.toString());
}
Also used : Memory(php.runtime.Memory) ArrayMemory(php.runtime.memory.ArrayMemory) Test(org.junit.Test)

Example 53 with Memory

use of php.runtime.Memory in project jphp by jphp-compiler.

the class UserFunctionTest method testWithArrayDefault.

@Test
public void testWithArrayDefault() {
    Memory memory = includeResource("user_function/with_array_default.php");
    Assert.assertEquals(10, memory.toLong());
}
Also used : Memory(php.runtime.Memory) ArrayMemory(php.runtime.memory.ArrayMemory) Test(org.junit.Test)

Example 54 with Memory

use of php.runtime.Memory in project jphp by jphp-compiler.

the class UserFunctionTest method testNested.

@Test
public void testNested() {
    Memory memory = includeResource("user_function/nested.php");
    Assert.assertEquals("success", memory.toString());
}
Also used : Memory(php.runtime.Memory) ArrayMemory(php.runtime.memory.ArrayMemory) Test(org.junit.Test)

Example 55 with Memory

use of php.runtime.Memory in project jphp by jphp-compiler.

the class UserFunctionTest method testWithParams.

@Test
public void testWithParams() {
    Memory memory = includeResource("user_function/with_params.php");
    Assert.assertEquals(6, memory.toLong());
}
Also used : Memory(php.runtime.Memory) ArrayMemory(php.runtime.memory.ArrayMemory) Test(org.junit.Test)

Aggregations

Memory (php.runtime.Memory)346 Test (org.junit.Test)124 ArrayMemory (php.runtime.memory.ArrayMemory)122 ObjectMemory (php.runtime.memory.ObjectMemory)75 LongMemory (php.runtime.memory.LongMemory)58 StringMemory (php.runtime.memory.StringMemory)58 ForeachIterator (php.runtime.lang.ForeachIterator)47 ReferenceMemory (php.runtime.memory.ReferenceMemory)40 KeyValueMemory (php.runtime.memory.KeyValueMemory)25 Invoker (php.runtime.invoke.Invoker)21 ArrayKeyMemory (php.runtime.memory.helper.ArrayKeyMemory)21 ArrayValueMemory (php.runtime.memory.helper.ArrayValueMemory)21 ShortcutMemory (php.runtime.memory.helper.ShortcutMemory)21 Environment (php.runtime.env.Environment)20 IObject (php.runtime.lang.IObject)19 UndefinedMemory (php.runtime.memory.helper.UndefinedMemory)16 ClassEntity (php.runtime.reflection.ClassEntity)16 TraceInfo (php.runtime.env.TraceInfo)12 File (java.io.File)7 LocalVariable (org.develnext.jphp.core.compiler.jvm.misc.LocalVariable)7