How to load SQL views in Fixtures for unit tests in Cakephp 3?

2015-10-02 Thread Gabriel Lau
My application has some sql views to perform complex queries in the 
database and be better able to filter the results based on these values.

One problem I encountered when running the unit tests is that Cake do not 
import sql views, just tables, breaking the application tests.


*- How can I solve this problem?*


*- Is there any other way to replace the SQL Views within the application?*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Controller Integration Testing not catching exceptions in Cake 3.x

2015-09-01 Thread Gabriel Lau
Hi,

I'm having problems with integration tests in my json API in moment of 
catch an exception thrown by the application.

In my *UsersController*:

request->allowMethod('get');

// ...
throw new \Cake\Core\Exception\Exception('catch me');
// ...
}
}

In my *UsersIntegrationTest*:

get('/users');

$this->assertResponseError();
}
}

The *$this->assertResponseError();* throws an Exception during the test run, 
failing all other tests.


I've trying using:

$this->setExpectedException('\Cake\Core\Exception\Exception');

but I can't catch anything.


*How can I solve this?*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Exception output issue

2014-03-08 Thread Gabriel Lau
Hello people,

I realized recently that when an exception is triggered through a view 
(calling a nonexistent helper, for example), the error message along with 
the error layout (if customized) are displayed after the contents of the 
view in that the error is being generated (before the DOCTYPE).

Is there any way to display only the error output without this content view?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Displaying error messages without the content of the current view.

2013-10-21 Thread Gabriel Lau
Hi folks,

how can i display error messages without the content of the current view?

For example: If a vendor file throws a PDOException, the error message is 
displayed inside my current view. First, the content of my current view is 
displayed (without any layout, just the content), then the error message 
with the error layout is appended to the output.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.