PHP Classes

File: libs/Twig/test/Twig/Tests/Fixtures/tests/defined.test

Recommend this page to a friend!
  Classes of william amed   Raptor 2   libs/Twig/test/Twig/Tests/Fixtures/tests/defined.test   Download  
File: libs/Twig/test/Twig/Tests/Fixtures/tests/defined.test
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 2,532 bytes
 

Contents

Class file image Download
--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 TwigTestFoo(), ); --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 TwigTestFoo(), ); --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