Skip to content

Commit 411e6ea

Browse files
committed
fix tests
1 parent 8cca0c5 commit 411e6ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tests/unit/VueManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testInjectedScript() {
9191
$this->vueManager->importExtend($extendOne);
9292
$this->vueManager->addVue($vue);
9393

94-
$script = "<script> Vue.prototype.\$http = axios; const state = Vue.observable({count: 0}); Vue.directive('focus',{inserted: function(el,binding,vnode,oldVnode){el.focus();}}); Vue.filter('capitalize',function(value){if(!value) return '';value = value.toString();return value.charAt(0).toUpperCase() + value.slice(1);}); Vue.component('component-one',{inheritAttrs: true, model: { prop: 'checked', event: 'change' }, props: [ 'first', 'second' ], activated: function(){console.log('ok');}, deactivated: function(){console.log('ok');}}); Vue.mixin({}); Vue.extend({mixins: [ MixinOne ]}); const ComponentOne = {inheritAttrs: true, model: { prop: 'checked', event: 'change' }, props: [ 'first', 'second' ], activated: function(){console.log('ok');}, deactivated: function(){console.log('ok');}}; const ComponentTwo = {extends: ComponentOne, 0: data :function(){return {message: Hello World !}}, template: '<p>{{ message }}</p>'}; const MixinOne = {}; const ExtendOne = {mixins: [ MixinOne ]}; const app = new Vue({el: '#app', components: { 'component-two': ComponentTwo }, directives: { focus: { inserted: function(el,binding,vnode,oldVnode){el.focus();} } }, filters: { capitalize: function(value){if(!value) returnvalue = value.toString();return value.charAt(0).toUpperCase() + value.slice(1);} }, data: { raw: true }, computeds: { fullName: { get: function(){return this.firstName+' '+this.lastName}, set: function(v){this.firstName=v[0];this.lastName=v[1]} } }, watch: { title: function(newTitle,oldTitle){console.log('Title change from '+ oldTitle +' to '+ newTitle)} }, mounted: function(){console.log('hook');}, beforeMount: function(){console.log('hook');}, beforeCreate: function(){console.log('hook');}, created: function(){console.log('hook');}, beforeDestroy: function(){console.log('hook');}, beforeUpdate: function(){console.log('hook');}, destroyed: function(){console.log('hook');}, updated: function(){this.\$nextTick(function () {console.log('hook');})}, methods: { alertUser: function(user){alert('Welcome ' + user);} }});</script>";
94+
$script = "<script>Vue.prototype.\$http=axios;conststate=Vue.observable({count:0});Vue.directive('focus',{inserted:function(el,binding,vnode,oldVnode){el.focus();}});Vue.filter('capitalize',function(value){if(!value)return'';value=value.toString();returnvalue.charAt(0).toUpperCase()+value.slice(1);});Vue.component('component-one',{inheritAttrs:true,model:{prop:'checked',event:'change'},props:['first','second'],activated:function(){console.log('ok');},deactivated:function(){console.log('ok');}});Vue.mixin({});Vue.extend({mixins:[MixinOne]});constComponentOne={inheritAttrs:true,model:{prop:'checked',event:'change'},props:['first','second'],activated:function(){console.log('ok');},deactivated:function(){console.log('ok');}};constComponentTwo={extends:ComponentOne,data:{message:'HelloWorld!'},template:'<p>{{message}}</p>'};constMixinOne={};constExtendOne={mixins:[MixinOne]};constapp=newVue({el:'#app',components:{'component-two':ComponentTwo},directives:{focus:{inserted:function(el,binding,vnode,oldVnode){el.focus();}}},filters:{capitalize:function(value){if(!value)returnvalue=value.toString();returnvalue.charAt(0).toUpperCase()+value.slice(1);}},data:{raw:true},computeds:{fullName:{get:function(){returnthis.firstName+''+this.lastName},set:function(v){this.firstName=v[0];this.lastName=v[1]}}},watch:{title:function(newTitle,oldTitle){console.log('Titlechangefrom'+oldTitle+'to'+newTitle)}},mounted:function(){console.log('hook');},beforeMount:function(){console.log('hook');},beforeCreate:function(){console.log('hook');},created:function(){console.log('hook');},beforeDestroy:function(){console.log('hook');},beforeUpdate:function(){console.log('hook');},destroyed:function(){console.log('hook');},updated:function(){this.\$nextTick(function(){console.log('hook');})},methods:{alertUser:function(user){alert('Welcome'+user);}}});</script>";
9595
$this->assertEqualsIgnoreNewLines($script, $this->vueManager->__toString());
9696
}
9797
}

0 commit comments

Comments
 (0)