cvs: pearweb /tests/site/account-request-confirm.php test_account_election_success.phpt
| From: | Helgi �ormar �orbj�rnsson | Date: | Sun, 10 Feb 2008 22:26:57 +0000 |
| Subject: | cvs: pearweb /tests/site/account-request-confirm.php test_account_election_success.phpt | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-50971@lists.php.net to get a copy of this message | ||
dufuz Sun Feb 10 22:26:57 2008 UTC
Modified files:
/pearweb/tests/site/account-request-confirm.php
test_account_election_success.phpt
Log:
Updating test, no idea why it still won't reconize the update query
http://cvs.php.net/viewvc.cgi/pearweb/tests/site/account-request-confirm.php/test_account_election_success.phpt?r1=1.3&r2=1.4&diff_format=u
Index: pearweb/tests/site/account-request-confirm.php/test_account_election_success.phpt
diff -u pearweb/tests/site/account-request-confirm.php/test_account_election_success.phpt:1.3
pearweb/tests/site/account-request-confirm.php/test_account_election_success.phpt:1.4
--- pearweb/tests/site/account-request-confirm.php/test_account_election_success.phpt:1.3 Fri Jun 15
01:47:31 2007
+++ pearweb/tests/site/account-request-confirm.php/test_account_election_success.phpt Sun Feb 10
22:26:57 2008
@@ -13,7 +13,8 @@
$_SERVER['QUERY_STRING'] = '';
require dirname(__FILE__) . '/setup.php.inc';
-$time = gmdate('Y-m-d H:i', strtotime('-15 minutes'));
+$time = gmdate('Y-m-d', strtotime('-1 day'));
+$time2 = gmdate('Y-m-d H:i');
$mock->addDeleteQuery("DELETE FROM election_account_request WHERE created_on <
'" . $time . "'", array(), array());
@@ -24,7 +25,7 @@
$mock->addDataQuery("SELECT id, created_on, salt, handle
FROM election_account_request
- WHERE salt='12345678901234567890123456789012'",
+ WHERE salt = '12345678901234567890123456789012'",
array(array(
'id' => 1,
'created_on' => gmdate('Y-m-d H:i', strtotime('-10
minutes')),
@@ -59,6 +60,60 @@
$mock->addDeleteQuery("DELETE FROM notes WHERE uid = 'helgi'", array(),
array());
+$mock->addDataQuery("SELECT * FROM users WHERE handle = 'helgi'",
+ array(array(
+ 'handle' => 'helgi',
+ 'password' => md5('hi'),
+ 'name' => 'Helgi Þormar Þorbjörnsson',
+ 'email' => 'helgith@gmail.com',
+ 'homepage' => 'http://www.helgi.ws',
+ 'created' => '2002-11-22 16:16:00',
+ 'createdby' => 'richard',
+ 'lastlogin' => NULL,
+ 'showemail' => '0',
+ 'registered' => '0',
+ 'admin' => '0',
+ 'userinfo' => '',
+ 'pgpkeyid' => '1F81E560',
+ 'pgpkey' => NULL,
+ 'wishlist' => '',
+ 'longitude' => '-96.6831931472',
+ 'latitude' => '40.7818087725',
+ 'active' => '1',
+ )), array('handle', 'password', 'name', 'email',
'homepage', 'created',
+ 'createdby', 'lastlogin', 'showemail', 'registered',
'admin', 'userinfo',
+ 'pgpkeyid', 'pgpkey', 'wishlist', 'longitude',
'latitude', 'active'));
+
+$mock->addUpdateQuery("UPDATE users SET
+registered = 1,
+created = '" . $time2 . "',
+createdby = 'pearweb' WHERE handle = 'helgi'",
+array("SELECT * FROM users WHERE handle = 'helgi'" => array(array (
+ 'handle' => 'helgi',
+ 'password' => 'as if!',
+ 'name' => 'Helgi Thormar',
+ 'email' => 'dufuz@php.net',
+ 'homepage' => 'http://pear.php.net',
+ 'created' => $time2,
+ 'createdby' => 'pearweb',
+ 'lastlogin' => NULL,
+ 'showemail' => '0',
+ 'registered' => '0',
+ 'admin' => '0',
+ 'userinfo' => '',
+ 'pgpkeyid' => '1F81E560',
+ 'pgpkey' => NULL,
+ 'wishlist' => NULL,
+ 'longitude' => '-96.6831931472',
+ 'latitude' => '40.7818087725',
+ 'active' => '1',
+ ),
+ 'cols' => array('handle', 'password', 'name',
'email', 'homepage', 'created',
+ 'createdby', 'lastlogin', 'showemail', 'registered',
'admin', 'userinfo',
+ 'pgpkeyid', 'pgpkey', 'wishlist', 'longitude',
'latitude', 'active')
+ )), 1);
+
+
$mock->addInsertQuery("INSERT INTO karma VALUES (1, 'helgi',
'pear.voter', 'pearweb', NOW())",
array(),
array());
@@ -81,14 +136,19 @@
2 => "
SELECT id, created_on, salt, handle
FROM election_account_request
- WHERE salt='12345678901234567890123456789012'
+ WHERE salt = '12345678901234567890123456789012'
",
3 => 'SELECT * FROM users WHERE handle = \'helgi\' AND registered =
\'0\'',
4 => 'DELETE FROM notes WHERE uid = \'helgi\'',
- 5 => "INSERT INTO karma VALUES (1, 'helgi', 'pear.voter',
'pearweb', NOW())",
- 6 => "INSERT INTO karma VALUES (1, 'helgi', 'pear.bug',
'pearweb', NOW())",
- 7 => "INSERT INTO notes (id,uid,nby,ntime,note)
VALUES(1,'helgi','pearweb','" . gmdate('Y-m-d H:i', time())
. "','Account opened')",
- 8 => "DELETE FROM election_account_request WHERE salt =
'12345678901234567890123456789012'",
+ 5 => 'SELECT * FROM users WHERE handle = \'helgi\'',
+ 6 => "UPDATE users SET
+registered = 1,
+created = '" . $time2 . "',
+createdby = 'pearweb' WHERE handle = 'helgi'",
+ 7 => "INSERT INTO karma VALUES (1, 'helgi', 'pear.voter',
'pearweb', NOW())",
+ 8 => "INSERT INTO karma VALUES (1, 'helgi', 'pear.bug',
'pearweb', NOW())",
+ 9 => "INSERT INTO notes (id, uid, nby, ntime, note) VALUES (1, 'helgi',
'pearweb', '" . gmdate('Y-m-d H:i', time()) . "',
'Account opened')",
+ 10 => "DELETE FROM election_account_request WHERE salt =
'12345678901234567890123456789012'",
), $mock->queries, 'queries');
__halt_compiler();
?>
@@ -97,14 +157,13 @@
%s
<title>PEAR :: Account confirmation</title>
%s
-<!-- START MAIN CONTENT -->
- <td class="content">
+ <div id="body">
- <h1>Confirm Account</h1><div class="success">Your account has been
activated, you can now vote in
+<h1>Confirm Account</h1><div class="success">Your account has been
activated, you can now vote in
PEAR elections that are for the general PHP public as well as open bugs in the bug
tracker</div>
- </td>
+ </div>
<!-- END MAIN CONTENT -->
%s
\ No newline at end of file