getDoctrine(); $bux = $r->getRepository('MuzichCoreBundle:User') ->findOneByUsername('bux') ; $hardtek = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Hardtek'); $tribe = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Tribe'); $youtube_width = '590'; $youtube_height = '300'; $element = new Element(); $element->setName('Mon bel element'); $element->setTags(json_encode(array($hardtek->getId(), $tribe->getId()))); $element->setUrl('http://www.youtube.com/watch?v=WC8qb_of04E'); $factory = new ElementManager($element, $r->getEntityManager(), $this->_container); $factory->proceedFill($bux); $url = 'http://www.youtube.com/embed/WC8qb_of04E'; $this->assertEquals($element->getName(), 'Mon bel element'); $this->assertEquals($element->getUrl(), 'http://www.youtube.com/watch?v=WC8qb_of04E'); $this->assertEquals($element->getTags(), array($hardtek, $tribe)); $this->assertEquals($element->getEmbed(), '' ); } /** * Test des création de code embed */ public function testEmbedsEngine() { $r = $this->getDoctrine(); $bux = $r->getRepository('MuzichCoreBundle:User') ->findOneByUsername('bux') ; $hardtek = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Hardtek'); $tribe = $r->getRepository('MuzichCoreBundle:Tag')->findOneByName('Tribe'); /* * - youtube.com && youtu.be */ $this->proceed_elementAndFill( $bux, 'dfd4z5d3s45sgf45645', 'http://www.youtube.com/watch?v=Itfg7UpkcSs&feature=g-vrec&context=G2e61726RVAAAAAAAAAg', array($hardtek->getId(), $tribe->getId()), '' ); $this->proceed_elementAndFill( $bux, 'dfd4z5d3s45sgf45645', 'http://www.youtube.com/watch?feature=player_detailpage&v=Itfg7UpkcSs#t=3s', array($hardtek->getId(), $tribe->getId()), '' ); $this->proceed_elementAndFill( $bux, 'dfd4z5d3s45sgf45645', 'http://youtu.be/Itfg7UpkcSs', array($hardtek->getId(), $tribe->getId()), '' ); $this->proceed_elementAndFill( $bux, 'dfd4z5d3s45sgf45645', 'http://www.youtube.com/watch?v=Itfg7UpkcSs', array($hardtek->getId(), $tribe->getId()), '' ); /* * - dailymotion.com */ $this->proceed_elementAndFill( $bux, 'fzgrj79ukl46ye4rgz6a', 'http://www.dailymotion.com/video/xafj1q_black-bomb-a-tales-from-the-old-sch_music', array($hardtek->getId(), $tribe->getId()), '' ); /* * - soundcloud.com */ $id = md5('http://soundcloud.com/matas/sets/library-project'); $this->proceed_elementAndFill( $bux, 'faez7tf8re9h4gf5j64dssz', 'http://soundcloud.com/matas/sets/library-project', array($hardtek->getId(), $tribe->getId()), ' ' ); $id = md5('http://soundcloud.com/matas/above-hyperion-redux'); $this->proceed_elementAndFill( $bux, 'faez7tf8re9h4gf5j64dssz', 'http://soundcloud.com/matas/above-hyperion-redux', array($hardtek->getId(), $tribe->getId()), ' ' ); $this->proceed_elementAndFill( $bux, 'faez7tf8re9h4gf5j64dssz', 'http://soundcloud.com/tracks/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D=', array($hardtek->getId(), $tribe->getId()), null ); $this->proceed_elementAndFill( $bux, 'faez7tf8re9h4gf5j64dssz', 'http://soundcloud.com/people/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D=', array($hardtek->getId(), $tribe->getId()), null ); $this->proceed_elementAndFill( $bux, 'faez7tf8re9h4gf5j64dssz', 'http://soundcloud.com/groups/search?q%5Bfulltext%5D=EEK+A+MOUSSE&q%5Btype%5D=&q%5Bduration%5D=', array($hardtek->getId(), $tribe->getId()), null ); /* * - jamendo.com */ $this->proceed_elementAndFill( $bux, 'gthyk456+liszz', 'http://www.jamendo.com/fr/album/30661', array($hardtek->getId(), $tribe->getId()), '     Catalogue professionnel de musique libre ' ); $this->proceed_elementAndFill( $bux, 'gthyk456+liszz', 'http://www.jamendo.com/fr/track/207079', array($hardtek->getId(), $tribe->getId()), '     Catalogue professionnel de musique libre ' ); $this->proceed_elementAndFill( $bux, 'gthyk456+liszz', 'http://www.jamendo.com/fr/search/all/psytrance', array($hardtek->getId(), $tribe->getId()), null ); $this->proceed_elementAndFill( $bux, 'gthyk456+liszz', 'http://www.jamendo.com/fr/artist/DJ_BETO', array($hardtek->getId(), $tribe->getId()), null ); /*/* * - deezer.com */ $this->proceed_elementAndFill( $bux, 'a9j4l56dsu8ra5gf647je', 'http://www.deezer.com/fr/music/pantera/far-beyond-driven-80398', array($hardtek->getId(), $tribe->getId()), '' ); $this->proceed_elementAndFill( $bux, 'g4th4545ku6kti456e456z', 'http://www.deezer.com/fr/music/playlist/18701350', array($hardtek->getId(), $tribe->getId()), '' ); } }