Page MenuHomeDevCentral

DockerHubNotificationTest.php
No OneTemporary

DockerHubNotificationTest.php

<?php
namespace Nasqueron\Notifications\Tests\Notifications;
use Nasqueron\Notifications\Notifications\DockerHubNotification;
use Nasqueron\Notifications\Tests\TestCase;
class DockerHubNotificationTest extends TestCase {
/**
* @var Nasqueron\Notifications\Notifications\DockerHubNotification
*/
private $notification;
/**
* @var stdClass
*/
private $payload;
public function setUp () {
$path = __DIR__ . '/../data/payloads/DockerHubPushPayload.json';
$this->payload = json_decode(file_get_contents($path));
$this->notification = new DockerHubNotification(
"Acme",
"push",
$this->payload
);
}
public function testProperties () {
$this->assertSame("DockerHub", $this->notification->service);
$this->assertSame("Acme", $this->notification->project);
$this->assertSame("docker", $this->notification->group);
$this->assertSame($this->payload, $this->notification->rawContent);
$this->assertSame("push", $this->notification->type);
$this->assertSame(
"New image pushed to Docker Hub registry for svendowideit/testhook by trustedbuilder",
$this->notification->text
);
$this->assertSame(
"https://registry.hub.docker.com/u/svendowideit/testhook/",
$this->notification->link
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, May 13, 16:58 (13 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572679
Default Alt Text
DockerHubNotificationTest.php (1 KB)

Event Timeline