PHP code example of testmonitor / teams-client

1. Go to this page and download the library: Download testmonitor/teams-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

testmonitor / teams-client example snippets




$teams = new \TestMonitor\Teams\Client('https://webhook.url/');

$card = new \TestMonitor\Teams\Resources\SimpleCard([
    'title' => 'Some title',
    'text' => 'Hello World!',
]);

$teams->postMessage($card);

$user = (object) ['name' => 'John Doe'];

$card = new \TestMonitor\Teams\Resources\CustomCard('New Issue', "{$user->name} created a new issue");

$card->setColor('7FB11B')
    ->addFacts('Issue **I365**', [
        'Status' => '**Open**',
        'Priority' => '**High**',
        'Resolution' => '**Unresolved**',
    ])
    ->addAction('Open in TestMonitor', 'https://www.testmonitor.com/');

$teams->postMessage($card);