Skip to content
Snippets Groups Projects
Commit e68b2064 authored by gloas's avatar gloas
Browse files

ajout des tests + refacto class abonne cosmogramme avant rel #9357

parent b56a449b
No related merge requests found
......@@ -355,6 +355,24 @@ class UserWithOneSubscriptionTest extends Storm_Test_ModelTestCase {
}
/** @test **/
public function oldUserMarcusWithAutoSubscribeCheckedOnConcertShouldNotAddMarcusToSubscriber() {
$this->concerts->setAutoSubscribe(true);
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Newsletter');
Class_Newsletter::whenCalled('findAllBy')
->with(['auto_subscribe'=>true])
->never();
$marcus = Class_Users::newInstanceWithId(2,['login'=>'Marcus',
'password'=>'vue']);
$marcus->save();
$this->assertNotContains($this->concerts, $marcus->getNewsletters());
}
public function testSavingMarcusWithNewSubscriptionsAddThem() {
$this->_setLoaderFindAllReturnsSubscriptionFor(array('role' => 'user',
'model' => $this->marcus));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment