示例#1
0
 public function testRetrieveEventi()
 {
     $es = new EventoService();
     $eventi = $es->retrieveEventi($this->pdo);
     $this->assertEquals(3, count($eventi));
     $this->assertEquals('Primo evento!', $eventi[0]['titolo']);
     $this->assertEquals('Secondo evento!', $eventi[1]['titolo']);
     $this->assertEquals('Terzo evento!', $eventi[2]['titolo']);
 }
示例#2
0
 public function testCreaNuovoEvento()
 {
     $data = array('titolo' => 'nuovo titolo swift', 'descrizione' => 'bla bla bla', 'data_inizio' => '15-10-2010', 'data_fine' => '18-10-2010');
     $es = new EventoService();
     $es->creaNuovoEvento($data, $this->pdo);
     $mail = file_get_contents('/var/www/phpday2010/test/mail/admin@example.com.1');
     $this->assertRegExp('/From: webmaster@example.com/', $mail);
     $this->assertRegExp('/To: admin@example.com/', $mail);
     $this->assertRegExp('/Subject: nuovo evento: nuovo titolo swift/', $mail);
     $this->assertRegExp('/stato pubblicato un nuovo evento/', $mail);
 }
示例#3
0
<?php

require_once '../lib/EventoService.php';
require_once '../lib/ConnectionManager.php';
if (!isset($_POST['crea_evento'])) {
    header('Location: http://localhost/phpday2010/web/nuovoevento.php');
}
$evento_s = new EventoService();
$evento_s->creaNuovoEvento($_POST, ConnectionManager::getConnection());
header('Location: http://localhost/phpday2010/web/nuovoevento.php?message=' . urlencode("Evento creato con successo!"));
示例#4
0
    <link rel="stylesheet" href="./css/ui-lightness/jquery-ui-1.8.1.custom.css" type="text/css" />
    <link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection">
    <link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="print">
    <!--[if lt IE 8]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

    <link rel="stylesheet" href="./css/main.css" type="text/css" />

  </head>
    <body>
    <div class="container">
        <div class="span-24 header ">
            <h2 class="prepend-1">Testare l'ignoto</h2>
        </div>
        <hr/>
        <?php 
$es = new EventoService();
?>
        <?php 
$eventi = $es->retrieveEventi(ConnectionManager::getConnection());
?>
        <div class="span-17 prepend-1 colborder">
            <?php 
foreach ($eventi as $evento) {
    ?>
            <div class="evento span-17">
              <h3><?php 
    echo $evento['titolo'];
    ?>
</h3>
              <p>Descrizione: <?php 
    echo $evento['descrizione'];