Reimplement testGenerateIdentifier to fix #321
Merge pull request #358 from bantu/ticket/321

Reimplement testGenerateIdentifier

* bantu/ticket/321:
  Reimplement testGenerateIdentifier to fix #321
Merge branch 'master' into php5

* master:
  Reimplement testGenerateIdentifier to fix #321