Comments (3)
I tried to reproduce your bug but with no luck:
Here is my test case agains default home page:
public function testDispatch()
{
$this->dispatch('');
$this->assertRequestRoute('cms/index/index');
$this->assertLayoutBlockCreated('left');
$this->assertLayoutBlockCreated('right');
$this->assertLayoutBlockRendered('content');
$this->assertLayoutBlockTypeOf('left', 'core/text_list');
$this->assertLayoutBlockNotTypeOf('left', 'core/links');
$this->assertResponseBodyContains('Magento');
$this->assertResponseBodyContains('Home Page');
$this->assertResponseBodyContains('Compare Products');
$this->assertResponseBodyNotContains('Non existing text');
// This will fail!
# $this->assertResponseBodyContains('Non existing text');
}
However I have some thoughts about your problem in general, it might be possible that you haven't specified your design/theme configuration for test case, since tests are executed agains default database, which design settings are:
- default/default.
So don't forget to specify your design in fixture, it is very easy:
config:
default/design/package/name: your_package
default/design/theme/default: your_theme
from ecomdev_phpunit.
I'm not sure I follow 100%.
Why is it necessary to specify any fixtures at all for a test like
this ? Wouldn't it make more sense if it worked out of the box ?
If I don't have any custom design or theme, what are good values to use
for your_package and your_theme that will work out of the box with 1.7 ?
On Fri, 2013-01-04 at 11:18 -0800, Ivan Chepurnyi wrote:
I tried to reproduce your bug but with no luck:
Here is my test case agains default home page:public function testDispatch() { $this->dispatch(''); $this->assertRequestRoute('cms/index/index'); $this->assertLayoutBlockCreated('left'); $this->assertLayoutBlockCreated('right'); $this->assertLayoutBlockRendered('content'); $this->assertLayoutBlockTypeOf('left', 'core/text_list'); $this->assertLayoutBlockNotTypeOf('left', 'core/links'); $this->assertResponseBodyContains('Magento'); $this->assertResponseBodyContains('Home Page'); $this->assertResponseBodyContains('Compare Products'); $this->assertResponseBodyNotContains('Non existing text'); // This will fail! # $this->assertResponseBodyContains('Non existing text'); }
However I have some thoughts about your problem in general, it might
be possible that you haven't specified your design/theme configuration
for test case, since tests are executed agains default database, which
design settings are:* default/default.
So don't forget to specify your design in fixture, it is very easy:
config:
default/design/package/name: your_package
default/design/theme/default: your_theme
—
Reply to this email directly or view it on GitHub.
The coming out tells the story.
savon - Saving your work to svn
https://apestaart.org/thomas/trac/
from ecomdev_phpunit.
You mentioned in the title of your ticket "load custom layout template", that supposed to mean that you have a custom layout file in custom theme that is somehow cannot not load template on particular page. That's why I suggested you to change current design package theme via fixture. It is mostly because test database is not a copy of your live db instance it is clean install though db upgrade scripts. If you haven't specified your theme in XML file or db upgrade, then it uses default Magento theme and your test case will not work!
Test framework is not affecting in any way the layout XML building and template file inclusion procedure and if you checked the following test case I provided to you, you'll see that assertResponseBodyContains() method is working without any problems.
from ecomdev_phpunit.
Related Issues (20)
- Global YAML Loader does not evaluate correctly
- getModelMock HOT 5
- Local fixtures are not deleted when shared fixtures are used
- Merge fixtures instead of overwriting HOT 1
- "Deprecated configuration setting 'strict' used"
- How to follow symlinks when using modman HOT 3
- Magento EE 1.14 HOT 6
- Calling Helper from a Model unit test, gives back wrong class HOT 2
- Exit code 0 silently after moving a shared fixture to private of another test HOT 2
- assertJsonMatch() without assertion fails
- Add to packagist HOT 2
- Documentation link is broken HOT 1
- HTTPS for unsecure baseurl not working
- Why master not up to date HOT 7
- Generating Flat tables
- Controller PHPUnit HOT 2
- Controller Unit Test Improvements HOT 4
- Duplication of class Spyc
- Readme.md : not all the installations steps are clear enough HOT 1
- Error while creating test db
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecomdev_phpunit.