Skip to content

Commit

Permalink
add functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
alavieille committed Dec 16, 2016
1 parent c44ed10 commit 065c972
Showing 1 changed file with 23 additions and 2 deletions.
Expand Up @@ -2,9 +2,10 @@

namespace OpenOrchestra\FunctionalTests\GroupBundle\Repository;

use OpenOrchestra\Backoffice\Repository\GroupRepositoryInterface;
use OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractKernelTestCase;
use OpenOrchestra\ModelBundle\Repository\SiteRepository;
use OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration;
use OpenOrchestra\UserBundle\Repository\GroupRepository;
use OpenOrchestra\GroupBundle\Document\Group;

/**
Expand All @@ -15,7 +16,7 @@
class GroupRepositoryTest extends AbstractKernelTestCase
{
/**
* @var GroupRepository
* @var GroupRepositoryInterface
*/
protected $repository;

Expand Down Expand Up @@ -173,6 +174,24 @@ public function testRemoveGroups()
$this->assertNull($this->repository->findOneByName('test'));
}

/**
* Test remove users
*/
public function testSoftDeleteGroupBySite()
{
$dm = static::$kernel->getContainer()->get('object_manager');
$site = $this->siteRepository->findOneBySiteId('3');
$this->repository->softDeleteGroupsBySite($site);

$groups = $this->repository->findAllWithSiteId($site->getId());

foreach ($groups as $group) {
$this->assertTrue($group->isDeleted());
$group->setDeleted(false);
}
$dm->flush();
}

/**
* Generate columns of content with search value
*
Expand All @@ -196,6 +215,8 @@ protected function generateSearchProvider($searchName = '', $globalSearch = '')

/**
* @param array $siteIds
*
* @return array
*/
protected function generateMongoIdForSite(array $siteIds)
{
Expand Down

0 comments on commit 065c972

Please sign in to comment.