diff --git a/bin/phpunit b/bin/phpunit index 7f687cc7..0198a08a 100755 --- a/bin/phpunit +++ b/bin/phpunit @@ -1,15 +1,13 @@ #!/bin/bash cwd=$(dirname $0) pushd ${cwd}/../src/ php -dzend_extension=xdebug.so \ vendor/bin/phpunit \ - --exclude-group imap \ --stop-on-defect \ --stop-on-error \ - --stop-on-failure \ - --testsuite Browser,Unit,Feature + --stop-on-failure $* popd diff --git a/src/tests/Feature/Jobs/DomainCreateTest.php b/src/tests/Feature/Jobs/DomainCreateTest.php index a51b35b6..e9d2c728 100644 --- a/src/tests/Feature/Jobs/DomainCreateTest.php +++ b/src/tests/Feature/Jobs/DomainCreateTest.php @@ -1,52 +1,52 @@ deleteTestDomain('domain-create-test.com'); } public function tearDown(): void { $this->deleteTestDomain('domain-create-test.com'); parent::tearDown(); } /** * Test job handle + * + * @group ldap */ public function testHandle(): void { - Queue::fake(); - $domain = $this->getTestDomain( 'domain-create-test.com', [ 'status' => Domain::STATUS_NEW, 'type' => Domain::TYPE_EXTERNAL, ] ); $this->assertFalse($domain->isLdapReady()); $job = new DomainCreate($domain); $job->handle(); $this->assertTrue($domain->fresh()->isLdapReady()); } } diff --git a/src/tests/Feature/Jobs/UserCreateTest.php b/src/tests/Feature/Jobs/UserCreateTest.php index 736eb5ce..49287390 100644 --- a/src/tests/Feature/Jobs/UserCreateTest.php +++ b/src/tests/Feature/Jobs/UserCreateTest.php @@ -1,51 +1,45 @@ deleteTestUser('new-job-user@' . \config('app.domain')); } public function tearDown(): void { $this->deleteTestUser('new-job-user@' . \config('app.domain')); parent::tearDown(); } /** * Test job handle + * + * @group ldap */ public function testHandle(): void { $user = $this->getTestUser('new-job-user@' . \config('app.domain')); $this->assertFalse($user->isLdapReady()); - /* - $mock = \Mockery::mock('alias:App\Backends\LDAP'); - $mock->shouldReceive('createUser') - ->once() - ->with($user) - ->andReturn(null); - */ - $job = new UserCreate($user); $job->handle(); $this->assertTrue($user->fresh()->isLdapReady()); } } diff --git a/src/tests/Feature/Jobs/UserVerifyTest.php b/src/tests/Feature/Jobs/UserVerifyTest.php index f2d15aa4..8bb3ee90 100644 --- a/src/tests/Feature/Jobs/UserVerifyTest.php +++ b/src/tests/Feature/Jobs/UserVerifyTest.php @@ -1,43 +1,31 @@ deleteTestUser('new-job-user@' . \config('app.domain')); - } - - public function tearDown(): void - { - $this->deleteTestUser('new-job-user@' . \config('app.domain')); - - parent::tearDown(); - } - /** * Test job handle + * + * @group imap */ public function testHandle(): void { - $user = $this->getTestUser('new-job-user@' . \config('app.domain')); + $user = $this->getTestUser('john@kolab.org'); + $user->status ^= User::STATUS_IMAP_READY; + $user->save(); $this->assertFalse($user->isImapReady()); $job = new UserVerify($user); $job->handle(); - $this->assertTrue($user->fresh()->isImapReady() === false); + $this->assertTrue($user->fresh()->isImapReady()); } }