File: ProgressEventTest.php

package info (click to toggle)
php-guzzlehttp 5.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,560 kB
  • ctags: 2,519
  • sloc: php: 11,610; makefile: 182; python: 22; sh: 6
file content (25 lines) | stat: -rw-r--r-- 763 bytes parent folder | download
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
<?php
namespace GuzzleHttp\Tests\Event;

use GuzzleHttp\Client;
use GuzzleHttp\Event\ProgressEvent;
use GuzzleHttp\Message\Request;
use GuzzleHttp\Transaction;

/**
 * @covers GuzzleHttp\Event\ProgressEvent
 */
class ProgressEventTest extends \PHPUnit_Framework_TestCase
{
    public function testContainsNumbers()
    {
        $t = new Transaction(new Client(), new Request('GET', 'http://a.com'));
        $p = new ProgressEvent($t, 2, 1, 3, 0);
        $this->assertSame($t->request, $p->getRequest());
        $this->assertSame($t->client, $p->getClient());
        $this->assertEquals(2, $p->downloadSize);
        $this->assertEquals(1, $p->downloaded);
        $this->assertEquals(3, $p->uploadSize);
        $this->assertEquals(0, $p->uploaded);
    }
}