mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-04 18:13:02 -04:00
63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\Marketing\Tests\Feature;
|
|
|
|
use App\Models\Subscription;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
use Tests\TestCase;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
class SubscriberTest extends TestCase
|
|
{
|
|
use DatabaseTransactions;
|
|
/**
|
|
* A basic unit test example.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function test_for_status_change()
|
|
{
|
|
$user = User::find(1);
|
|
$this->actingAs($user);
|
|
|
|
$subscriber = Subscription::create([
|
|
'status' => 1,
|
|
'email' => '[email protected]'
|
|
]);
|
|
|
|
$this->post('/marketing/subscriber/status',[
|
|
'status' => 0,
|
|
'id' => $subscriber->id
|
|
|
|
])->assertSee('SL');
|
|
|
|
}
|
|
|
|
public function test_for_delete_subscriber()
|
|
{
|
|
$user = User::find(1);
|
|
$this->actingAs($user);
|
|
|
|
$subscriber = Subscription::create([
|
|
'status' => 1,
|
|
'email' => '[email protected]'
|
|
]);
|
|
|
|
$this->post('/marketing/subscriber/delete',[
|
|
'id' => $subscriber->id
|
|
|
|
])->assertSee('SL');
|
|
|
|
}
|
|
public function test_for_get_data()
|
|
{
|
|
$user = User::find(1);
|
|
$this->actingAs($user);
|
|
|
|
$this->get('/marketing/subscribers/get-data')->assertSee('recordsTotal');
|
|
|
|
}
|
|
}
|