summaryrefslogtreecommitdiff
path: root/test/MailmanLibTest.php
blob: d8bf4af1d2f5801c2804cd3a1b4cc274f978de8d (plain)
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

require_once('PHPUnit/Framework.php');
require_once('src/MailmanLib.php');

class MailmanLibTest extends PHPUnit_Framework_TestCase {
  
  /**
   * @dataProvider provider_read_raw_message
   */
  public function test_read_raw_message($url, $expected, $ex) {
    if ($ex) $this->setExpectedException($ex);
    $this->assertEquals($expected, read_raw_message($url));
  }

  public function provider_read_raw_message() {
    return array(
      array(__DIR__ . '/empty', null, 'Exception'),
      array(__DIR__ . '/bougs', null, 'Exception'),
      array(__DIR__ . '/1',     file_get_contents(__DIR__ . '/1'), null),
    );
  }
}

?>