public function testPut()
 {
     $announcement = new Announcement();
     $announcement->setId('1');
     $announcement->setTitle('Annonce test');
     $announcement->setSubtitle('Description modifiée');
     $announcement->setContent('Besoin de mécanicien contre cours de cuisine');
     $announcement->setPostDate('2012-12-14 18:07:27');
     $announcement->setConclued('0');
     $announcementMapper = new AnnouncementMapper();
     $announcementMapper->setId(1);
     $announcementMapper->updateAnnouncement($announcement);
     $this->assertEquals($announcement, $announcementMapper->selectAnnouncement());
 }
            Rest::sendResponse(204);
        }
        break;
    case 'delete':
        $announcementMapper = new \AnnouncementMapper();
        if ($announcementMapper->deleteAnnouncement()) {
            Rest::sendResponse(200);
        }
        break;
    case 'put':
        try {
            $announcement = new Announcement();
            $data_announcement = $http->getRequestVars();
            $announcementObject = initObject($data_announcement, $announcement, true);
            if (!emptyObject($announcementObject)) {
                $announcementMapper = new \AnnouncementMapper();
                if ($announcementMapper->updateAnnouncement($announcementObject)) {
                    Rest::sendResponse(200);
                }
            } else {
                throw new InvalidArgumentException('Need arguments to UPDATE data !');
            }
        } catch (InvalidArgumentException $e) {
            print $e->getMessage();
            exit;
        }
        break;
    default:
        Rest::sendResponse(501);
        break;
}