Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

assertTemplateName returns too early #59

Open
SorX14 opened this issue Jan 16, 2018 · 1 comment
Open

assertTemplateName returns too early #59

SorX14 opened this issue Jan 16, 2018 · 1 comment

Comments

@SorX14
Copy link

SorX14 commented Jan 16, 2018

assertTemplateName appears to return too early, and does not recursively search all child templates (see below).

<?php

public function myAction()
{
	$vm = new ViewModel();

	$child1 = (new ViewModel())->setTemplate('foo');
	$child2 = (new ViewModel())->setTemplate('bar');

	$vm->addChild($child1);
	$vm->addChild($child2);

	return $vm;
}

...

class testCase extends AbstractHttpControllerTestCase {
	
	public function testMyAction()
	{
		$this->dispatch('/my/action', 'GET', []);
		$this->assertTemplateName('foo'); // <-- true
		$this->assertTemplateName('bar'); // <-- false
	}

}
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-test; a new issue has been opened at laminas/laminas-test#3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants