123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- --TEST--
- "defined" test
- --TEMPLATE--
- {{ definedVar is defined ? 'ok' : 'ko' }}
- {{ definedVar is not defined ? 'ko' : 'ok' }}
- {{ undefinedVar is defined ? 'ko' : 'ok' }}
- {{ undefinedVar is not defined ? 'ok' : 'ko' }}
- {{ zeroVar is defined ? 'ok' : 'ko' }}
- {{ nullVar is defined ? 'ok' : 'ko' }}
- {{ nested.definedVar is defined ? 'ok' : 'ko' }}
- {{ nested['definedVar'] is defined ? 'ok' : 'ko' }}
- {{ nested.definedVar is not defined ? 'ko' : 'ok' }}
- {{ nested.undefinedVar is defined ? 'ko' : 'ok' }}
- {{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }}
- {{ nested.undefinedVar is not defined ? 'ok' : 'ko' }}
- {{ nested.zeroVar is defined ? 'ok' : 'ko' }}
- {{ nested.nullVar is defined ? 'ok' : 'ko' }}
- {{ nested.definedArray.0 is defined ? 'ok' : 'ko' }}
- {{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }}
- {{ object.foo is defined ? 'ok' : 'ko' }}
- {{ object.undefinedMethod is defined ? 'ko' : 'ok' }}
- {{ object.getFoo() is defined ? 'ok' : 'ko' }}
- {{ object.getFoo('a') is defined ? 'ok' : 'ko' }}
- {{ object.undefinedMethod() is defined ? 'ko' : 'ok' }}
- {{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }}
- {{ object.self.foo is defined ? 'ok' : 'ko' }}
- {{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }}
- {{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }}
- --DATA--
- return array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'nested' => array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'definedArray' => array(0),
- ),
- 'object' => new Foo(),
- );
- --EXPECT--
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- --DATA--
- return array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'nested' => array(
- 'definedVar' => 'defined',
- 'zeroVar' => 0,
- 'nullVar' => null,
- 'definedArray' => array(0),
- ),
- 'object' => new Foo(),
- );
- --CONFIG--
- return array('strict_variables' => false)
- --EXPECT--
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
- ok
|