Skip to content
Snippets Groups Projects
Commit cb41013e authored by Øyvind gjesdal's avatar Øyvind gjesdal
Browse files

add Haanga test changes

parent f70295eb
No related branches found
No related tags found
1 merge request!1Resolve "Ta inn endringer fra skeivt arkiv lodspeakr"
Showing
with 162 additions and 10 deletions
language: php
script: phpunit
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
{
"name": "crodas/Haanga",
"description": "Template compiler for PHP, Django-style (as much as possible). Pretty efficent by avoiding to have anything at run-time.",
"version": "v1.0.7",
"authors": [
{
"name": "César D. Rodas",
"email": "crodas@php.net"
}
],
"require": {
},
"autoload": {
"classmap": [
"lib/"
]
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnError = "true"
stopOnFailure = "true"
stopOnIncomplete = "true"
stopOnSkipped = "ture"
syntaxCheck = "true"
strict = "false"
verbose = "true"
debug = "true"
bootstrap = "tests/bootstrap.php" >
<testsuites>
<testsuite name="Haanga tests">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>tests/</directory>
<directory suffix=".php">lib/</directory>
</whitelist>
</filter>
</phpunit>
......@@ -4,6 +4,6 @@
{% if 13 & 2 == 0 %}
Match
{% endif %}
{% if 15 | 8 == 15 %}
{% if 15 || 8 == 15 %}
Match
{% endif %}
a
b
<?php
if (!class_exists('Obj', false)) {
require __DIR__ . '/bug25_class.php';
}
$data = array('obj' => new Obj);
{% for a in obj.method %}
{{ a }}
{% endfor %}
a
a
test
<?php
if (!class_exists('Obj', false)) {
require __DIR__ . '/bug25_class.php';
}
$data = array('obj' => new Obj, 'base' => array('endpoint' => 'a'));
{% for a in obj.endpoint %}
{{ base.endpoint }}
{% if forloop.last %}
test
{% endif %}
{% endfor %}
<?php
class Obj
{
public function endpoint() {
return $this->method();
}
public function method(){
return array('a', 'b');
}
}
1: f
1: o
1: o
1: ,
1: b
1: a
1: r
w: foo
w: bar
<?php
$data = array('text' => 'foo,bar');
{% for w in text|explode %}
1: {{ w }}
{% endfor %}
{% for w in text|explode:"," %}
w: {{ w }}
{% endfor %}
VALUE
value
vale
5
&quot;value&quot;
&quot;VALUE&quot;
&quot;value&quot;
&quot;vale&quot;
7
DEFAULT VALUE
HOLA QUE
......
<?php
$data = array('var' => 'value');
$data = array('var' => '"value"');
{{ var|default:"foobar" }}
{{ var|upper }}
{{ var|upper|lower }}
{{ var|cut:"u" }}
......
{% if 1 == 2 || 1+2 == 3 %}True{% else %}False{% endif %}
{% if 1 == 2 OR 1+2 == 3 %}True{% else %}False{% endif %}
{% if var|upper == var %}True{% else %}False{% endif %}
{% if 1 === 2 || 1+2 === 3 %}True{% else %}False{% endif %}
{% if 1 === 2 OR 1+2 === 3 %}True{% else %}False{% endif %}
{% if 1 !== 2 %}True{% else %}False{% endif %}
{% if 1 > 2 %}True{% else %}False{% endif %}
{% if 1 >= 2 %}True{% else %}False{% endif %}
......
......@@ -17,7 +17,7 @@
Users with 22 years
bar
continue
Users with 22 years
foo
Users with 23 years
......
{% load "../contrib/meneame_pagination.php" %}
{% load "../../contrib/meneame_pagination.php" %}
{% meneame_pagination page results_per_page total %}
{% if mnm_prev %}
<span class="nextprev">&#171; Previous</span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment