[FLOW3-general] Unit Testing
Karsten Dambekalns
karsten at typo3.org
Thu Oct 18 12:46:57 CEST 2012
Hi.
On 16.10.12 09:26, Christian Peters wrote:
> - after rewieving some of the tests you've written, I wonder if you are
> using the AccessibleMock to create the class under test itself. I guess
> that's how you do dependency injection; but how is this a testable class
> then? Is there somewhere some information about this Accessible Mock?
Just check the BaseTestCase - an accessible mock is a regular PHPUnit
mock, with the added methods _call(), _callRef(), _set(), _setRef() and
_get() to access protected members.
For DI we recently added inject() to the BaseTestCase to make it even
easier.
> - I can't run the testsuite (phpunit claims that it can't redeclare
> Autoloader.php). I assume this is because phpunit uses the autoloader for
> itself. Is there any workaround for that or am I doing something wrong?
How are you running phpunit? Please show the command…
> - I want to write about TYPO3.Blog, as it's used throughout the docs. I run
> the migrate Script and it resulted in a strange structure (essentially
> rebuilding the folder structure under /Classes). Is that correct? Is the
> Blog example up to date anyway or would it be a better idea to use a
> generic example?
Git tells me the Blog has been last updated in June. So, yes, it is
outdated. I hope Robert can push his updates, as he already uses it on a
current Flow setup.
Regards,
Karsten
--
Karsten Dambekalns
TYPO3 Core Developer, Neos / Flow Team
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the FLOW3-general
mailing list