Skip to content

Commit

Permalink
Fixing failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 16, 2010
1 parent 9e74283 commit a054695
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
6 changes: 5 additions & 1 deletion cake/libs/controller/components/paginator.php
Expand Up @@ -104,7 +104,11 @@ public function paginate($object = null, $scope = array(), $whitelist = array())
if (!is_object($object)) {
throw new MissingModelException($object);
}
$options = array_merge($this->Controller->request->params, $this->Controller->params['url'], $this->Controller->passedArgs);
$options = array_merge(
$this->Controller->request->params,
$this->Controller->request->query,
$this->Controller->passedArgs
);

if (isset($this->settings[$object->alias])) {
$defaults = $this->settings[$object->alias];
Expand Down
9 changes: 5 additions & 4 deletions cake/tests/cases/console/shells/api.test.php
Expand Up @@ -76,10 +76,11 @@ public function testMethodNameDetection () {
'16. render($action = NULL, $layout = NULL, $file = NULL)',
'17. set($one, $two = NULL)',
'18. setAction($action)',
'19. shutdownProcess()',
'20. startupProcess()',
'21. validate()',
'22. validateErrors()'
'19. setRequest($request)',
'20. shutdownProcess()',
'21. startupProcess()',
'22. validate()',
'23. validateErrors()'
);
$this->Shell->expects($this->at(2))->method('out')->with($expected);

Expand Down
10 changes: 6 additions & 4 deletions cake/tests/cases/libs/cake_socket.test.php
Expand Up @@ -34,7 +34,8 @@ class CakeSocketTest extends CakeTestCase {
* @return void
*/
function setUp() {
$this->Socket = new CakeSocket();
parent::setUp();
$this->Socket = new CakeSocket(array('timeout' => 1));
}

/**
Expand All @@ -44,6 +45,7 @@ function setUp() {
* @return void
*/
function tearDown() {
parent::tearDown();
unset($this->Socket);
}

Expand All @@ -54,7 +56,7 @@ function tearDown() {
* @return void
*/
function testConstruct() {
$this->Socket->__construct();
$this->Socket = new CakeSocket();
$config = $this->Socket->config;
$this->assertIdentical($config, array(
'persistent' => false,
Expand Down Expand Up @@ -108,8 +110,8 @@ function testSocketConnection() {
*/
public static function invalidConnections() {
return array(
array(array('host' => 'invalid.host')),
array(array('host' => '127.0.0.1', 'port' => '70000'))
array(array('host' => 'invalid.host', 'timeout' => 1)),
array(array('host' => '127.0.0.1', 'port' => '70000', 'timeout' => 1))
);
}

Expand Down
9 changes: 7 additions & 2 deletions cake/tests/cases/libs/controller/components/email.test.php
Expand Up @@ -1087,13 +1087,18 @@ function testReset() {
$this->Controller->EmailTest->additionalParams = 'X-additional-header';
$this->Controller->EmailTest->delivery = 'smtp';
$this->Controller->EmailTest->smtpOptions['host'] = 'blah';
$this->Controller->EmailTest->smtpOptions['timeout'] = 0.5;
$this->Controller->EmailTest->smtpOptions['timeout'] = 0.2;
$this->Controller->EmailTest->attachments = array('attachment1', 'attachment2');
$this->Controller->EmailTest->textMessage = 'This is the body of the message';
$this->Controller->EmailTest->htmlMessage = 'This is the body of the message';
$this->Controller->EmailTest->messageId = false;

$this->assertFalse($this->Controller->EmailTest->send('Should not work'));
try {
$this->Controller->EmailTest->send('Should not work');
$this->fail('No exception');
} catch (SocketException $e) {
$this->assertTrue(true, 'SocketException raised');
}

$this->Controller->EmailTest->reset();

Expand Down

0 comments on commit a054695

Please sign in to comment.