def test_dict(self): php = PHP() values = php.array_values(self.TEST_DICT) php.sort(values) php.echo(php.implode(',', values)) expected = ','.join(sorted(self.TEST_DICT.itervalues())) self.assertEquals(str(php), expected)