If you are using subclasses of PHPUnit's TestCase
, you should call parent::__construct
in order to benefit @dataProvider
s.
But the tricky part is that TestCase::_construct
receives some arguments. So, you should define them in your inherited class and pass them to the parent::__construct
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection | |
from django.db.models.base import ModelBase | |
from django.test import TestCase | |
class AbstractModelTestCase(TestCase): | |
"""Utility class to test abstract/mixin models | |
Abstract models doesn't allow you to make instances and Django will not create tables for them. | |
This utility class creates a temporary subclass for the abstract models, and creates the table for it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
class TestCase extends BaseTestCase | |
{ | |
use CreatesApplication; | |
protected $headers = ['accept' => 'application/json']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
class TestCase extends BaseTestCase | |
{ | |
use CreatesApplication; | |
protected $headers = ['accept' => 'application/json']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use Tests\TestCase; | |
class DataProviderTest extends TestCase | |
{ | |
/** | |
* @dataProvider additionProvider |
-
پیکرهگان: انواع پیکرهها (دادههای متنی و غیرمتنی زبانی) را به عنوان مجموعۀ دادههای زبانی میشناسیم. پایگاه پیکرهگان با هدف ایجاد شرایط مناسب برای اشتراکگذاری مجموعه دادههای زبانی و دسترسی آسان پژوهشگران به این مجموعه دادهها ایجاد شده است.
-
متنکاوی: مجموعه کم نظیر از سرویسها، ابزارها و خدمات سفارشی متن کاوی برای پژوهشگران و سازمانها
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using ServiceStack; | |
using ServiceStack.Text; | |
using System.Collections.Generic; | |
public class Request | |
{ | |
public bool? IsOk {get; set;} | |
} |
(C) 2015 by Derek Hunziker, (C) 2017 by AppsOn
As of releasing MongoDB 3.4 and C# Driver v2.4, original cheatsheet by Derek is outdated. In addition, it has some deficiencies like connecting to MongoDB, creating indexes, etc. This updated version works fine with C# Driver v2.4.7 and MongoDB v3.4.
Note: Defined models and collections will be used in entire cheatsheet.