Search in sources :

Example 26 with Memory

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

the class IncludeTest method testSimpleInclude.

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

Example 27 with Memory

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

the class IncludeTest method testRequire.

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

Example 28 with Memory

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

the class LoopsTest method testDoWhile.

@Test
public void testDoWhile() {
    Memory memory = includeResource("loops/do_while.php");
    Assert.assertEquals("AAAAAAAAA", memory.toString());
}
Also used : Memory(php.runtime.Memory) Test(org.junit.Test)

Example 29 with Memory

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

the class LoopsTest method testFor.

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

Example 30 with Memory

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

the class ArrayMemoryTest method testSimple.

@Test
public void testSimple() {
    ArrayMemory memory = new ArrayMemory();
    assertEquals(Memory.Type.ARRAY, memory.type);
    assertEquals(0, memory.size());
    assertEquals(-1, memory.lastLongIndex);
    Memory mem = ArrayMemory.valueOf();
    assertTrue(mem instanceof ArrayMemory);
    assertEquals(-1, ((ArrayMemory) mem).lastLongIndex);
    assertEquals(0, ((ArrayMemory) mem).size());
}
Also used : Memory(php.runtime.Memory) 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