PEAR2_Services_NYTimes-0.1.0PEAR2_Services_NYTimes-0.1.0/test/pear2.php.net/PEAR2_Services_NYTimes/Services/NYTimes/BaseTest.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
 * PEAR2\Services\NYTimes\BaseTest
 *
 * PHP version 5
 *
 * @category  Services
 * @package   PEAR2_Services_NYTimes
 * @author    Till Klampaeckel <till@php.net>
 * @copyright 2011 Till Klampaeckel
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @version   SVN: $Id$
 * @link      https://github.com/pear2/Services_NYTimes
 */

/**
 * BaseTest covers {@link \PEAR2\Services\NYTimes\Base}.
 *
 * @category  Services
 * @package   PEAR2_Services_NYTimes
 * @author    Till Klampaeckel <till@php.net>
 * @copyright 2011 Till Klampaeckel
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @link      https://github.com/pear2/Services_NYTimes
 */
namespace PEAR2\Services\NYTimes;
class BaseTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @expectedException InvalidArgumentException
     */
    public function testFormat()
    {
        $newswire = new Newswire('apikey');
        $newswire->setResponseFormat('yaml'); // haha, yaml, haha Symfony
    }

    public function testSetRequest()
    {
        $newswire = new Newswire('apikey');

        $req = new \HTTP_Request2;
        $req->setAdapter('mock');

        $this->assertInstanceOf('PEAR2\Services\NYTimes\Newswire', $newswire->accept($req));
    }
}
EOF