Skip to content
Snippets Groups Projects
Unverified Commit ca61a1cc authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #2314 from nextcloud/techdept/pure-unit-tests

Move IMAP and DB tests to \OCA\Mail\Tests\Integration
parents 412296d2 4eef79e7
No related branches found
No related tags found
No related merge requests found
......@@ -26,3 +26,7 @@ coverage/
# vim
.*.sw?
# PHPunit temp file
tests/.phpunit.result.cache
<?php
<?php declare(strict_types=1);
/**
* @author Tahaa Karim <tahaalibra@gmail.com>
......@@ -19,19 +19,19 @@
*
*/
namespace OCA\Mail\Db;
namespace OCA\Mail\Tests\Integration\Db;
use OC;
use ChristophWurst\Nextcloud\Testing\DatabaseTransaction;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\Mail\Db\Alias;
use OCA\Mail\Db\AliasMapper;
use OCA\Mail\Db\MailAccount;
use OCA\Mail\Db\MailAccountMapper;
use OCP\IDBConnection;
/**
* Class AliasMapperTest
*
* @group DB
*
* @package OCA\Mail\Db
*/
class AliasMapperTest extends TestCase {
......
......@@ -20,21 +20,17 @@
*
*/
namespace OCA\Mail\Tests\Unit\Db;
namespace OCA\Mail\Tests\Integration\Db;
use OC;
use OCA\Mail\Db\CollectedAddress;
use OCA\Mail\Db\CollectedAddressMapper;
use ChristophWurst\Nextcloud\Testing\DatabaseTransaction;;
use ChristophWurst\Nextcloud\Testing\DatabaseTransaction;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\IDBConnection;
/**
* Class CollectedAddressMapperTest
*
* @group DB
*
* @package OCA\Mail\Tests\Unit\Db
*/
class CollectedAddressMapperTest extends TestCase {
......
<?php
<?php declare(strict_types=1);
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
......@@ -19,19 +19,17 @@
*
*/
namespace OCA\Mail\Db;
namespace OCA\Mail\Tests\Integration\Db;
use OC;
use ChristophWurst\Nextcloud\Testing\DatabaseTransaction;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\Mail\Db\MailAccount;
use OCA\Mail\Db\MailAccountMapper;
use OCP\IDBConnection;
/**
* Class MailAccountMapperTest
*
* @group DB
*
* @package OCA\Mail\Db
*/
class MailAccountMapperTest extends TestCase {
......
<?php
<?php declare(strict_types=1);
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
......@@ -19,9 +19,10 @@
*
*/
namespace OCA\Mail\Db;
namespace OCA\Mail\Tests\Integration\Db;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\Mail\Db\MailAccount;
class MailAccountTest extends TestCase {
......
......@@ -21,12 +21,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace OCA\Mail\Tests\Unit\Db;
namespace OCA\Mail\Tests\Integration\Db;
use ChristophWurst\Nextcloud\Testing\DatabaseTransaction;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\Mail\Account;
use OCA\Mail\Db\Mailbox;
use OCA\Mail\Db\MailboxMapper;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\DB\QueryBuilder\IQueryBuilder;
......
......@@ -21,7 +21,7 @@
*
*/
namespace OCA\Mail\Tests\Unit\IMAP;
namespace OCA\Mail\Tests\Integration\IMAP;
use ChristophWurst\Nextcloud\Testing\TestCase;
use Exception;
......
......@@ -22,7 +22,9 @@
*
*/
namespace OCA\Mail\Tests\Unit\IMAP;
namespace OCA\Mail\Tests\Integration\IMAP;
use OCA\Mail\Tests\Integration\IMAP\AbstractTest;
/**
* @group IMAP
......
<?php
<?php declare(strict_types=1);
/**
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
......@@ -19,7 +19,7 @@
*
*/
namespace OCA\Mail\Tests\Unit\IMAP;
namespace OCA\Mail\Tests\Integration\IMAP;
use Horde_Imap_Client_Socket;
use OC;
......@@ -30,17 +30,17 @@ use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\Security\ICrypto;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit\Framework\MockObject\MockObject;
class IMAPClientFactoryTest extends TestCase {
/** @var ICrypto|PHPUnit_Framework_MockObject_MockObject */
/** @var ICrypto|MockObject */
private $crypto;
/** @var IConfig|PHPUnit_Framework_MockObject_MockObject */
/** @var IConfig|MockObject */
private $config;
/** @var ICacheFactory|PHPUnit_Framework_MockObject_MockObject */
/** @var ICacheFactory|MockObject */
private $cacheFactory;
/** @var IMAPClientFactory */
......@@ -83,7 +83,7 @@ class IMAPClientFactoryTest extends TestCase {
$this->assertInstanceOf(Horde_Imap_Client_Socket::class, $client);
}
public function testClientConectivity() {
public function testClientConnectivity() {
$account = $this->getTestAccount();
$this->crypto->expects($this->once())
->method('decrypt')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment