Beispiel #1
0
 public function setUp()
 {
     parent::setUp();
     $this->userId = 217784;
     $this->board = new PulseBoard(19306968);
     $this->pulse = $this->board->createPulse('Flapping Umbrella', $this->userId, 'dynamic_pulses');
 }
Beispiel #2
0
 public function setUp()
 {
     parent::setUp();
     $this->id = 19306968;
     $this->userId = 217784;
     $this->board = new PulseBoard($this->id);
     $this->pulses = $this->board->getPulses();
 }
Beispiel #3
0
 public function testCreateUpdate()
 {
     $pulse = $this->board->createPulse("Neurotic Jackhammer Detective", $this->userId);
     $updateContent = self::updateProvider();
     $pulse->createUpdate($updateContent[0][0], $updateContent[0][1]);
     $pulse->createUpdate($updateContent[1][0], $updateContent[1][1]);
     $this->assertCountEqual(2, $pulse->getUpdates());
     return $pulse;
 }
 /**
  * @depends testBoardCreation
  *
  * @param   mixed $arrayOfValues
  */
 public function testBoardDeletion($arrayOfValues)
 {
     /* @var $board PulseBoard */
     $board = $arrayOfValues["board"];
     $board->archiveBoard();
     $currentBoardCount = count(PulseBoard::getBoards());
     $this->assertEquals($arrayOfValues["initial"], $currentBoardCount);
 }
Beispiel #5
0
 public function setUp()
 {
     $authClient = new AuthenticatedClient("phpunit-auth.json");
     if (!$authClient->isAuthenticationSetup()) {
         $this->markTestSkipped();
     }
     PulseBoard::setApiKey($authClient->getApiToken());
     VCR::turnOn();
     VCR::insertCassette('PhpPulseVCR');
 }
 /**
  * @depends testAddingSubscriber
  */
 public function testRemovingSubscriber()
 {
     $this->board->removeSubscriber($this->user2);
     $subscribers = $this->board->getSubscribers();
     $this->assertCountEqual(1, $subscribers);
 }
Beispiel #7
0
<?php

use allejo\DaPulse\PulseBoard;
// Create the main application
$app = new Silex\Application();
// Register kernel extensions
$app->register(new DerAlex\Silex\YamlConfigServiceProvider(__DIR__ . '/../config.yml'));
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
// Register Twig extensions
$app['twig'] = $app->share($app->extend('twig', function ($twig, $app) {
    $twig->addExtension(new allejo\DaPulser\Twig\DateParserFilter($app));
    $twig->addExtension(new allejo\DaPulser\Twig\WufooUploadFilter($app));
    return $twig;
}));
// Setup our DaPulse library
PulseBoard::setApiKey($app['config']['dapulse']['apikey']);
return $app;
Beispiel #8
0
 public function testCreatePulseInGroup()
 {
     $myGroup = $this->pulseBoard->createGroup("Unicorn Group");
     $newPulse = $this->pulseBoard->createPulse("Feed the Unicorn", $this->userID, $myGroup->getId());
     $this->assertEquals($myGroup->getId(), $newPulse->getGroupId());
 }
Beispiel #9
0
 private function webRequestPost($content, $fields)
 {
     $entryId = $fields["EntryId"];
     $priority = $fields["Field113"];
     $webProjectsBoard = new PulseBoard($this->webRequestsId);
     $newPulse = $webProjectsBoard->createPulse("Web Request #" . $entryId, $this->vladId, "web_requests");
     $newPulse->getTextColumn("text")->updateValue($priority);
     $newPulse->getPersonColumn("person")->updateValue($this->vladId);
     $newPulse->addNote("Web Request Details", $content);
     return $newPulse->getId();
 }
Beispiel #10
0
 private function pulseInjection(&$result)
 {
     $parentBoard = new PulseBoard($this->getBoardId());
     // Inject some information so a Pulse object can survive on its own
     $result["pulse"]["group_id"] = $result["board_meta"]["group_id"];
     $result["pulse"]["column_structure"] = $parentBoard->getColumns();
     $result["pulse"]["raw_column_values"] = $result["column_values"];
 }
Beispiel #11
0
 public function testGetBoardUpdatedAt()
 {
     $this->assertInstanceOf("DateTime", $this->board->getUpdatedAt());
 }