abstractclassTestCaseextendsBaseTestCase {useCreatesApplication; /** * Indicates whether the default seeder should run before each test. * * @varbool@@ */protected $seed =true;protectedfunctionsetUp():void {parent::setUp();echo'run SetUp';// TODO: Change the autogenerated stub } }
This is my base class. I am put correct setUp(). And I see "run SetUp" each test.
I found another way how use same user in my tests.
stackoverflow.com
Hi Povilas. I try to use this. But it doesn't work. I am put SetUp function to parrent class but SetUp run enyway for each test..
Maybe you name it differently? It should be
setUp()
notSetUp()
Just guessing, it's hard to debug for you remotely what you did wrong.Thanks for reply.
This is my base class. I am put correct setUp(). And I see "run SetUp" each test.
I found another way how use same user in my tests. stackoverflow.com
Summary:
Hello, excellent tip, but how do I do it if I want to use the same function in several Test Classes, but not in all of them?
I guess then you need to use/call that function specifically in the classes where you need it.