示例#1
0
 def test_string(self):
     string = 'a'
     as_var = php_var_dump('string', string)
示例#2
0
 def test_def(self):
     """This should fail!"""
     def deffed(): return 1
     self.assertRaises(ValueError, lambda: php_var_dump('deffed', deffed))
示例#3
0
 def test_lambda(self):
     """This should fail!"""
     lambdad = lambda x: x ** 2
     self.assertRaises(ValueError, lambda: php_var_dump('lambdad', lambdad))
示例#4
0
 def test_long(self):
     longed = long(1.99123)
     as_var = php_var_dump('longed', longed)
示例#5
0
 def test_float(self):
     floated = float(2.912)
     as_var = php_var_dump('floated', floated)
示例#6
0
 def test_none(self):
     none = None
     as_var = php_var_dump('none', none)
示例#7
0
 def test_bool(self):
     bool = True
     as_var = php_var_dump('bool', bool)
     bool = False
     as_var = php_var_dump('bool', bool)
示例#8
0
 def test_tuple(self):
     tuple = (1, 2, 3)
     as_var = php_var_dump('tuple', tuple)
示例#9
0
 def test_dict(self):
     dict = {'a': 1, 'b': 2, 'c': 3, }
     as_var = php_var_dump('dict', dict)
示例#10
0
 def test_list_of_lists(self):
     list_of_lists = ['a', ['1', '2'], 'b', ['3', '4'], 'c']
     as_var = php_var_dump('list_of_lists', list_of_lists)
示例#11
0
 def test_list(self):
     list = ['a', 'b']
     as_var = php_var_dump('list', list)
示例#12
0
 def test_int(self):
     int = 1
     as_var = php_var_dump('int', int)
示例#13
0
 def test_string_utf8(self):
     string = 'a'
     string = unicode(string, 'utf-8')
     as_var = php_var_dump('string', string)
示例#14
0
 def test_string_unicode(self):
     string = 'a'
     string = unicode(string)
     as_var = php_var_dump('string', string)