Completed
Pull Request — master (#25)
by
unknown
04:49
created

TestHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A addSentEmails() 0 15 2
1
<?php
2
namespace Azine\EmailBundle\Tests;
3
4
use Azine\EmailBundle\Entity\SentEmail;
5
use Azine\EmailBundle\Services\AzineTemplateProvider;
6
use Doctrine\ORM\EntityManager;
7
8
class TestHelper
9
{
10
    /**
11
     * @param integer $count
12
     */
13
    public static function addSentEmails(EntityManager $manager, $count)
14
    {
15
        while ($count > 0) {
16
            $sentEmail = new SentEmail();
17
            $sentEmail->setRecipients(array('[email protected]'));
18
            $sentEmail->setSent(new \DateTime("2 weeks ago"));
19
            $sentEmail->setTemplate(AzineTemplateProvider::NEWSLETTER_TEMPLATE);
20
            $sentEmail->setVariables(array());
21
            $sentEmail->setToken('fdasdfasfafsadf');
22
            $manager->persist($sentEmail);
23
24
            $count--;
25
        }
26
        $manager->flush();
27
    }
28
 }
29