5db4623e319c99c91a26c4123a1d342ea4bff5c2

Author: gwoo

Date: 2009-12-15 22:57:42 -0800

udpating git test to work on other systems

diff --git a/plugins/repo/tests/cases/models/git.test.php b/plugins/repo/tests/cases/models/git.test.php index db64849..e63b250 100644 --- a/plugins/repo/tests/cases/models/git.test.php +++ b/plugins/repo/tests/cases/models/git.test.php @@ -82,15 +82,12 @@ class GitTest extends CakeTestCase { $Git->push(); $data = $Git->read(); - + unset($data['email'], $data['author'], $data['committer'], $data['committer_email']); + $this->assertEqual($data, array( 'hash' => $data['hash'], 'revision' => $data['revision'], 'commit_date' => date('Y-m-d H:i:s O', strtotime('now')), - 'email' => 'gwoo@cakephp.org', - 'author' => 'gwoo', - 'committer' => 'gwoo', - 'committer_email' => 'gwoo@cakephp.org', 'message' => 'Updating git ignore again', 'subject' => 'Updating git ignore again', )); @@ -218,9 +215,6 @@ class GitTest extends CakeTestCase { $this->assertEqual($result[0]['Repo']['message'], 'Updating git ignore'); $this->assertEqual($result[1]['Repo']['message'], 'Initial Project Commit'); - $this->assertEqual($result[0]['Repo']['committer'], 'gwoo'); - $this->assertEqual($result[1]['Repo']['committer'], 'gwoo'); - $result = $Git->find('all', array('path' => TMP . 'tests/git/working/test/master/.gitignore', 'limit' => 1)); @@ -249,33 +243,27 @@ class GitTest extends CakeTestCase { $Git->commit(array("-m", "'Updating git ignore'")); $Git->push(); - $result = $Git->find('first', array('fields' => array('email', 'author'))); - $this->assertEqual($result, array( - 'email' => 'gwoo@cakephp.org', - 'author' => 'gwoo' - )); + $result = $Git->find('first', array('fields' => array('email', 'author'))); + $this->assertTrue(!empty($result['email'])); + $this->assertTrue(!empty($result['author'])); $result = $Git->find('first'); $newrev = $result['hash']; + unset($result['email'], $result['author'], $result['committer'], $result['committer_email']); + $this->assertEqual($result, array( 'hash' => $result['hash'], 'revision' => $result['revision'], 'commit_date' => date('Y-m-d H:i:s O', strtotime('now')), - 'email' => 'gwoo@cakephp.org', - 'author' => 'gwoo', - 'committer' => 'gwoo', - 'committer_email' => 'gwoo@cakephp.org', 'message' => 'Updating git ignore', 'subject' => 'Updating git ignore' )); //Test Find By Commit $result = $Git->find(array('hash' => $newrev, 'fields' => array('email', 'author', 'hash'))); - $this->assertEqual($result, array( - 'email' => 'gwoo@cakephp.org', - 'author' => 'gwoo', - 'hash' => $newrev, - )); + $this->assertTrue(!empty($result['email'])); + $this->assertTrue(!empty($result['author'])); + $this->assertEqual($result['hash'], $newrev); /* $Git = new Git(array(