Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Merge ce81a67 into 95b4329
Browse files Browse the repository at this point in the history
  • Loading branch information
neok committed Oct 19, 2017
2 parents 95b4329 + ce81a67 commit 95d2051
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
21 changes: 8 additions & 13 deletions Tests/DependencyInjection/ConfigurationTest.php
@@ -1,45 +1,40 @@
<?php

namespace Vresh\TwilioBundle\Tests\DependencyInjection;

use Symfony\Component\Yaml\Parser;
use Vresh\TwilioBundle\DependencyInjection\Configuration;

/**
* Test the configuration tree
* Test the configuration tree.
*
* @author Fridolin Koch <info@fridokoch.de>
*
*/
class ConfigurationTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function testGetConfigTreeBuilder()
{
$config = new Configuration();
/** @var \Symfony\Component\Config\Definition\ArrayNode $node */
/** @var \Symfony\Component\Config\Definition\ArrayNode $node */
$tree = $config->getConfigTreeBuilder()->buildTree();
//check root name
$this->assertEquals('twilio', $tree->getName());
//get child nodes and check them
/** @var \Symfony\Component\Config\Definition\ScalarNode[] $children */
/** @var \Symfony\Component\Config\Definition\ScalarNode[] $children */
$children = $tree->getChildren();
//check length
$this->assertEquals(4, count($children));
$this->assertCount(4, $children);
//check if all config values are available
$this->assertArrayHasKey('sid', $children);
$this->assertArrayHasKey('authToken', $children);
$this->assertArrayHasKey('version', $children);
$this->assertArrayHasKey('retryAttempts', $children);
}

/**
* @test
*/
public function testYamlFile()
{
$yaml = new Parser();
$config = $yaml->parse(file_get_contents(realpath(__DIR__ . '/../../Resources/config/services.yml')));
$yaml = new Parser();
$config = $yaml->parse(file_get_contents(realpath(__DIR__.'/../../Resources/config/services.yml')));
//validate config
$this->assertArrayHasKey('parameters', $config);
$this->assertArrayHasKey('services', $config);
Expand Down
23 changes: 4 additions & 19 deletions Tests/Service/TwilioWrapperTest.php
@@ -1,31 +1,25 @@
<?php

namespace Vresh\TwilioBundle\Tests\DependencyInjection;

use Vresh\TwilioBundle\Service\TwilioLookupsWrapper;
use Vresh\TwilioBundle\Service\TwilioWrapper,
Vresh\TwilioBundle\Service\TwilioCapabilityWrapper;
use Vresh\TwilioBundle\Service\TwilioWrapper;
use Vresh\TwilioBundle\Service\TwilioCapabilityWrapper;

/**
* Test the TwilioWrapper
* Test the TwilioWrapper.
*
* @author Fridolin Koch <info@fridokoch.de>
*
*/
class TwilioWrapperTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function testTwilioWrapper()
{
$twilio = new TwilioWrapper('AAAA', 'XXXX');
//check if instance
$this->assertInstanceOf('Vresh\TwilioBundle\Service\TwilioWrapper', $twilio);
}

/**
* @test
*/
public function testCreateInstance()
{
$twilio = new TwilioWrapper('AAAA', 'XXXX');
Expand All @@ -35,19 +29,13 @@ public function testCreateInstance()
$this->assertInstanceOf('\Services_Twilio', $otherInstance);
}

/**
* @test
*/
public function testCapabilityWrapper()
{
$twilio = new TwilioCapabilityWrapper('AAAA', 'XXXX');
//check class
$this->assertInstanceOf('\Services_Twilio_Capability', $twilio);
}

/**
* @test
*/
public function testCapabilityCreateInstance()
{
$twilio = new TwilioCapabilityWrapper('AAAA', 'XXXX');
Expand All @@ -57,9 +45,6 @@ public function testCapabilityCreateInstance()
$this->assertInstanceOf('\Services_Twilio_Capability', $otherInstance);
}

/**
* @test
*/
public function testLookupsWrapper()
{
$twilio = new TwilioLookupsWrapper('AAAA', 'XXXX');
Expand Down

0 comments on commit 95d2051

Please sign in to comment.