Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Unit Tests

on:
pull_request:
push:

jobs:
unit-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP 8.5
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
tools: composer
coverage: none

- name: Validate composer.json
run: composer validate --no-check-publish

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run plugin unit tests
run: composer run test:unit
2 changes: 1 addition & 1 deletion LSTelegramNotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function afterSurveyComplete()
* @param $surveyId
* @param $text
*/
public function sendMessage($surveyId, $responseId, $chatId, Api $telegram, $title)
public function sendMessage(int $surveyId, int $responseId, string $chatId, Api $telegram, string $title): void
{
$sendMessage = $this->get(
'SendMessage',
Expand Down
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
{
"name": "librecodecoop/lstelegramnotify",
"description": "LimeSurvey plugin to notify survey submissions in Telegram",
"type": "limesurvey-plugin",
"license": "AGPL-3.0-or-later",
"require": {
"irazasyed/telegram-bot-sdk": "^3.9"
},
"require-dev": {
"phpunit/phpunit": "^11.0"
},
"autoload": {
"classmap": [
"LSTelegramNotify.php"
]
},
"autoload-dev": {
"files": [
"tests/Support/LimeSurveyStubs.php"
],
"psr-4": {
"LSTelegramNotify\\Tests\\": "tests/"
}
},
"scripts": {
"test:unit": "phpunit -c phpunit.xml"
}
}
Loading
Loading