Skip to content

Commit

Permalink
test code update
Browse files Browse the repository at this point in the history
  • Loading branch information
shazeedul committed Oct 10, 2024
1 parent be75f34 commit 5612040
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
"smsapi",
"smsapimany",
"SYED"
]
],
"intelephense.environment.includePaths": [
"./vendor/pestphp",
"./vendor/phpunit/phpunit",
"./vendor/laravel"
],
}
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"pestphp/pest": "^1.23",
"pestphp/pest-plugin-laravel": "^1.4",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.6",
"spatie/laravel-ray": "^1.26"
},
"autoload": {
Expand Down Expand Up @@ -85,4 +85,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ includes:
parameters:
level: 4
paths:
- config
- src
- tests
tmpDir: build/phpstan
# checkOctaneCompatibility: true
Expand Down
27 changes: 16 additions & 11 deletions tests/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,53 @@

// Test Set BulkSmsBd Config Mode log
test('set BulkSmsBd Config Mode log', function () {
config(['bulksmsbd.mode' => 'log']);
$this->assertEquals('log', config('bulksmsbd.mode'));
expect(config('bulksmsbd.mode'))->toEqual('log');
});

// Check BulkSmsBd Instance Test
test('check BulkSmsBd instance', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class, \Nanopkg\BulkSmsBd\Facades\BulkSmsBd::getFacadeRoot());
expect(\Nanopkg\BulkSmsBd\Facades\BulkSmsBd::getFacadeRoot())->toBeInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class);
});

// Check BulkSmsBd OneToOne Test
test('check BulkSmsBd OneToOne', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class, \Nanopkg\BulkSmsBd\Facades\BulkSmsBd::OneToOne('8801700000000', 'message'));
expect(\Nanopkg\BulkSmsBd\Facades\BulkSmsBd::OneToOne('8801700000000', 'message'))
->toBeInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class);
});

// Check BulkSmsBd OneToMany Test
test('check BulkSmsBd OneToMany', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class, \Nanopkg\BulkSmsBd\Facades\BulkSmsBd::OneToMany(['8801700000000', '8801800000000'], 'message'));
expect(\Nanopkg\BulkSmsBd\Facades\BulkSmsBd::OneToMany(['8801700000000', '8801800000000'], 'message'))
->toBeInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class);
});

// Check BulkSmsBd ManyToMany Test
test('check BulkSmsBd ManyToMany', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class, \Nanopkg\BulkSmsBd\Facades\BulkSmsBd::ManyToMany([
expect(\Nanopkg\BulkSmsBd\Facades\BulkSmsBd::ManyToMany([
['to' => '8801700000000', 'message' => 'message'],
]));
]))->toBeInstanceOf(\Nanopkg\BulkSmsBd\BulkSmsBd::class);
});

// Check BulkSmsBd Send Test
test('check BulkSmsBd Send', function () {
$this->assertTrue(\Nanopkg\BulkSmsBd\Facades\BulkSmsBd::send());
expect(\Nanopkg\BulkSmsBd\Facades\BulkSmsBd::send())
->toBeTrue();
});

// Check BulkSmsBd OneToOne Job Test
test('check BulkSmsBd OneToOne Job', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToOne::class, new \Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToOne('8801700000000', 'message'));
expect(new \Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToOne('8801700000000', 'message'))
->toBeInstanceOf(\Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToOne::class);
});

// Check BulkSmsBd OneToMany Job Test
test('check BulkSmsBd OneToMany Job', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToMany::class, new \Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToMany(['8801700000000', '8801800000000'], 'message'));
expect(new \Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToMany(['8801700000000', '8801800000000'], 'message'))
->toBeInstanceOf(\Nanopkg\BulkSmsBd\Jobs\BulkSmsBdOneToMany::class);
});

// Check BulkSmsBd Channel Test
test('check BulkSmsBd Channel', function () {
$this->assertInstanceOf(\Nanopkg\BulkSmsBd\Broadcasting\BulkSmsBdChannel::class, new \Nanopkg\BulkSmsBd\Broadcasting\BulkSmsBdChannel);
expect(new \Nanopkg\BulkSmsBd\Broadcasting\BulkSmsBdChannel)
->toBeInstanceOf(\Nanopkg\BulkSmsBd\Broadcasting\BulkSmsBdChannel::class);
});

0 comments on commit 5612040

Please sign in to comment.