Kevin423/BasDeM — pull request #2 by defel (2012-08-26 14:55:21+00:00)
Title: - fix unittest testSetAndGetAuthor

Hi,

this commit fix testSetAndGetAuthor, as 'Anonym' is returned by Memplex when author is empty ( 7002eea05097b3791896d322fdb2d3a08db5be9c ).

Before:
```
PHPUnit 3.6.0 by Sebastian Bergmann.

.E..E....FFFF...........

Time: 0 seconds, Memory: 6.75Mb

There were 2 errors:

1) TestMemplex::testConstruct
Undefined variable: _SESSION

…/BasDeM/www/class/user.class.php:204
…/BasDeM/www/class/memplex.class.php:130
…/BasDeM/www/class/memplex.class.php:63
…/BasDeM/tests/TestMemplex.php:57

2) TestMemplex::testToArray
Undefined variable: _SESSION

…/BasDeM/www/class/user.class.php:204
…/BasDeM/www/class/memplex.class.php:130
…/BasDeM/www/class/memplex.class.php:63
…/BasDeM/tests/TestMemplex.php:106

--

There were 4 failures:

1) TestMemplex::testSetAndGetAuthor with data set #0 ('')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-''
+'Anonym'

…/BasDeM/tests/TestMemplex.php:135

2) TestMemplex::testSetAndGetAuthor with data set #1 ('test')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-''
+'Anonym'

…/BasDeM/tests/TestMemplex.php:135

3) TestMemplex::testSetAndGetAuthor with data set #2 ('äöüß')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-''
+'Anonym'

…/BasDeM/tests/TestMemplex.php:135

4) TestMemplex::testSetAndGetAuthor with data set #3 ('
')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-''
+'Anonym'

…/BasDeM/tests/TestMemplex.php:135

FAILURES!
Tests: 24, Assertions: 47, Failures: 4, Errors: 2.
```

After:
```
PHPUnit 3.6.0 by Sebastian Bergmann.

F..F...................

Time: 0 seconds, Memory: 6.25Mb

There were 2 failures:

1) TestMemplex::testConstruct
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'testauthor'
+'Anonym'

…/BasDeM/tests/TestMemplex.php:63

2) TestMemplex::testToArray
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
'id' => 0
- 'author' => 'testauthor'
+ 'author' => Array (...)
'title' => 'testtitle'
'text' => 'testtext'
'layer' => 42
'children' => null
+ 'moderationstate' => 0
+ 'favored' => 0
+ 'selffavored' => 0
)

…/BasDeM/tests/TestMemplex.php:112

FAILURES!
Tests: 23, Assertions: 59, Failures: 2.
```